Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2011-2014 BonitaSoft S.A. BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
package org.bonitasoft.engine.api;

Matthieu Chaffotte
Aurelien Pupier
public class EJB3ServerAPI implements ServerAPI {
    private static final long serialVersionUID = 1L;
    private final ServerAPI remoteServAPI;
    public EJB3ServerAPI(final Map<StringStringparametersthrows ServerAPIException {
        try {
             = lookup("serverAPI"new Hashtable<StringString>(parameters));
        } catch (final NamingException e) {
            throw new ServerAPIException(e);
    private ServerAPI lookup(final String namefinal Hashtable<StringStringenvironmentthrows NamingException {
        InitialContext initialContext = null;
        if (environment != null) {
            initialContext = new InitialContext(environment);
        } else {
            initialContext = new InitialContext();
        return (ServerAPIinitialContext.lookup(name);
    public Object invokeMethod(final Map<StringSerializableoptionsfinal String apiInterfaceNamefinal String methodName,
    	final List<StringclassNameParametersfinal Object[] parametersValuesthrows ServerWrappedExceptionRemoteException {
    	return .invokeMethod(optionsapiInterfaceNamemethodNameclassNameParametersparametersValues);
New to GrepCode? Check out our FAQ X