use of jp.ossc.nimbus.service.aop.InterceptorChainFactory in project nimbus by nimbus-org.
the class EJBDriveDispatcher method init.
/**
* EJBローカルを取得する。
* @param unitOfWorkKey
* @param commandKey
* @param intercetorFactrySvcName
* @param interceptorCreateKey
* @param loggerServiceName
* @throws NamingException
* @throws CreateException
* @throws RemoteException
*/
public void init(String unitOfWorkKey, String commandKey, String intercetorFactrySvcName, String interceptorCreateKey, String loggerServiceName) throws NamingException, CreateException {
InitialContext ctx = new InitialContext();
String value = null;
// Logger
try {
value = (String) ctx.lookup(loggerServiceName);
} catch (NamingException e) {
}
if (value == null || value.length() == 0) {
this.mLogger = null;
} else {
ServiceName serviceName = UtilTool.convertServiceName(value);
this.mLogger = (Logger) ServiceManagerFactory.getService(serviceName);
}
// ユニットオブワークLocal取得
value = (String) ctx.lookup(unitOfWorkKey);
mUnitOfWorkInvokerHome = (SLSBUnitOfWorkHomeLocal) ctx.lookup(value);
// コマンドLocal取得
value = (String) ctx.lookup(commandKey);
mCommandInvokerHome = (SLSBCommandHomeLocal) ctx.lookup(value);
// インターセプターファクトリ取得
value = (String) ctx.lookup(intercetorFactrySvcName);
if (value == null || value.length() == 0) {
mFactory = null;
} else {
ServiceName serviceName = UtilTool.convertServiceName(value);
Object factory = ServiceManagerFactory.getService(serviceName);
if (factory instanceof InterceptorChainInvokerFactory) {
mFactory = (InterceptorChainInvokerFactory) factory;
} else if (factory instanceof InterceptorChainFactory) {
chainFactory = (InterceptorChainFactory) factory;
}
// interceptor Factory Key
value = (String) ctx.lookup(interceptorCreateKey);
mInterceptorKey = value;
}
if (this.getLogger() != null) {
this.getLogger().write(IOC__00001, "InterceptorChainInvokerFactory get completed.");
}
}
use of jp.ossc.nimbus.service.aop.InterceptorChainFactory in project nimbus by nimbus-org.
the class SLSBCommandBean method ejbCreate.
/**
* EJBを作成する。
* @throws javax.ejb.CreateException
*/
public void ejbCreate() throws javax.ejb.CreateException {
InitialContext ctx = null;
try {
ctx = new InitialContext();
// ログの取得
String value = null;
// Logger
try {
value = (String) ctx.lookup(C_LOGGER_JNDI_KEY);
} catch (NamingException e) {
}
ServiceName serviceName = null;
Logger logger = null;
if (value != null && value.length() > 0) {
serviceName = UtilTool.convertServiceName(value);
logger = (Logger) ServiceManagerFactory.getService(serviceName);
}
// インターセプチェインタファクトリーサービスの取得
InterceptorChainInvokerFactory iciFactory = null;
InterceptorChainFactory icFactory = null;
value = (String) ctx.lookup(C_INTERCEPTOR_SERVICE_NAME_JNDI_KEY);
if (value != null && value.length() > 0) {
serviceName = UtilTool.convertServiceName(value);
Object factory = ServiceManagerFactory.getService(serviceName);
if (factory instanceof InterceptorChainInvokerFactory) {
iciFactory = (InterceptorChainInvokerFactory) factory;
} else {
icFactory = (InterceptorChainFactory) factory;
}
}
// Beanフローファクトリーサービスの取得
value = (String) ctx.lookup(C_BEAN_FLOW_SERVICE_NAME_JNDI_KEY);
serviceName = UtilTool.convertServiceName(value);
BeanFlowInvokerFactory bfFactory = (BeanFlowInvokerFactory) ServiceManagerFactory.getService(serviceName);
super.init(logger, iciFactory, icFactory, bfFactory);
} catch (NamingException e) {
CreateException ce = new CreateException("InitialContext Error");
ce.initCause(e);
throw ce;
}
}
Aggregations