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
Julien Reboul
public class EJB3ServerAPI implements ServerAPI {
    public static final String EJB_NAMING_REFERENCE_PROPERTY = "org.bonitasoft.engine.ejb.naming.reference";
    private static final long serialVersionUID = 1L;
    protected volatile ServerAPI remoteServAPI;
    protected static final String SERVER_API_BEAN_NAME_JBOSS7 = "ejb:bonita-ear/bonita-ejb/serverAPIBean!org.bonitasoft.engine.api.internal.ServerAPI";
    protected Map<StringStringparameters;
    public EJB3ServerAPI(final Map<StringStringparametersthrows ServerAPIException {
        this. = parameters;
    public EJB3ServerAPI() throws RemoteException {
    protected 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);
    protected void initServerAPIReference() throws ServerAPIException {
        String serverAPIBeanName;
        if ( == null || (serverAPIBeanName = .get()) == null) {
            serverAPIBeanName = ;
        try {
             = lookup(serverAPIBeanNamenew Hashtable<StringString>(
        } catch (final NamingException e) {
            throw new ServerAPIException("[" + serverAPIBeanName + "] Reference To Server API does not exists. Edit"
                    + . + " property to change the reference name"e);
New to GrepCode? Check out our FAQ X