
org.ow2.bonita.facade.impl.StandardInternalAPIAccessorImpl Maven / Gradle / Ivy
/**
* Copyright (C) 2006 Bull S. A. S.
* Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois
* 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.ow2.bonita.facade.impl;
import java.lang.reflect.Proxy;
import org.ow2.bonita.facade.APIAccessor;
import org.ow2.bonita.facade.APIInterceptor;
import org.ow2.bonita.facade.internal.InternalAPIAccessor;
import org.ow2.bonita.facade.internal.InternalCommandAPI;
import org.ow2.bonita.facade.internal.InternalManagementAPI;
import org.ow2.bonita.facade.internal.InternalRuntimeAPI;
public class StandardInternalAPIAccessorImpl extends StandardInternalQueryAPIAccessorImpl implements InternalAPIAccessor {
public InternalRuntimeAPI getRuntimeAPI() {
final Class clazz = InternalRuntimeAPI.class;
final APIInterceptor apiInterceptor = new APIInterceptor(new RuntimeAPIImpl());
return (InternalRuntimeAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(),
new Class[] {clazz}, apiInterceptor);
}
public InternalManagementAPI getManagementAPI() {
final Class clazz = InternalManagementAPI.class;
final APIInterceptor apiInterceptor = new APIInterceptor(new ManagementAPIImpl());
return (InternalManagementAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(),
new Class[] {clazz}, apiInterceptor);
}
public InternalCommandAPI getCommandAPI() {
final Class clazz = InternalCommandAPI.class;
final APIInterceptor apiInterceptor = new APIInterceptor(new CommandAPIImpl());
return (InternalCommandAPI) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(),
new Class[] {clazz}, apiInterceptor);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy