use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.
the class ServiceNameRefEditorTest method testSetAsText2.
public void testSetAsText2() throws Exception {
ServiceNameRefEditor editor = new ServiceNameRefEditor();
editor.setServiceManagerName("Manager1");
editor.setAsText("Service1=Service1");
assertEquals(new ServiceNameRef("Service1", new ServiceName("Service1")), editor.getValue());
}
use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.
the class ObjectMappedEditorFinderService method startService.
/* (非 Javadoc)
* @see jp.ossc.nimbus.core.ServiceBaseSupport#startService()
*/
public void startService() throws Exception {
// 上位リポジトリの取得
if (mFinderServiceName != null) {
this.mParentFinder = (EditorFinder) ServiceManagerFactory.getServiceObject(this.mFinderServiceName);
}
ServiceNameEditor editor = new ServiceNameEditor();
editor.setServiceManagerName(getServiceManagerName());
// 自分が管理するエディターサービスの設定
Iterator iterator = mEditorMap.keySet().iterator();
while (iterator.hasNext()) {
String classAndKey = (String) iterator.next();
String key = null;
String clsName = null;
final int index = classAndKey.indexOf(',');
if (index == -1) {
clsName = classAndKey;
} else {
clsName = classAndKey.substring(0, index);
if (index != classAndKey.length() - 1) {
key = classAndKey.substring(index + 1);
}
}
Class cls = convertStringToClass(clsName);
JournalEditor journalEditor = null;
Object value = mEditorMap.get(classAndKey);
if (value instanceof String) {
String serviceName = (String) value;
editor.setAsText(serviceName);
ServiceName name = (ServiceName) editor.getValue();
journalEditor = (JournalEditor) ServiceManagerFactory.getServiceObject(name);
} else if (value instanceof JournalEditor) {
journalEditor = (JournalEditor) value;
}
Map keyEditorMap = (Map) mEditorRepository.getValueOf(cls);
if (keyEditorMap == null) {
keyEditorMap = new HashMap();
mEditorRepository.add(cls, keyEditorMap);
}
keyEditorMap.put(key, journalEditor);
}
}
use of jp.ossc.nimbus.core.ServiceName 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.core.ServiceName in project nimbus by nimbus-org.
the class ScheduleManagerServlet method init.
/**
* サーブレットの初期化を行う。<p>
* サービス定義のロード及びロード完了チェックを行う。
*
* @exception ServletException サーブレットの初期化に失敗した場合
*/
public synchronized void init() throws ServletException {
ServiceName jsonConverterServiceName = getJSONConverterServiceName();
if (jsonConverterServiceName == null) {
jsonConverter = new BeanJSONConverter();
DateFormatConverter dateFormatConverter = new DateFormatConverter(DateFormatConverter.DATE_TO_STRING, "yyyyMMddHHmmssSSS");
dateFormatConverter.setNullString(null);
jsonConverter.setFormatConverter(Date.class, dateFormatConverter);
} else {
jsonConverter = (BeanJSONConverter) ServiceManagerFactory.getServiceObject(jsonConverterServiceName);
}
jsonConverter.setCharacterEncodingToStream("UTF-8");
jsonConverter.setUnicodeEscape(isUnicodeEscape());
toStringConverter = new StringStreamConverter(StringStreamConverter.STREAM_TO_STRING);
toStringConverter.setCharacterEncodingToObject("UTF-8");
ServiceName scheduleManagerServiceName = getScheduleManagerServiceName();
if (scheduleManagerServiceName == null) {
throw new ServletException("ScheduleManagerServiceName is null.");
} else {
scheduleManager = (ScheduleManager) ServiceManagerFactory.getServiceObject(scheduleManagerServiceName);
}
ServiceName schedulerServiceName = getSchedulerServiceName();
if (schedulerServiceName != null) {
scheduler = (Scheduler) ServiceManagerFactory.getServiceObject(schedulerServiceName);
}
}
use of jp.ossc.nimbus.core.ServiceName in project nimbus by nimbus-org.
the class ScheduleManagerServlet method getSchedulerServiceName.
private ServiceName getSchedulerServiceName() {
final ServletConfig config = getServletConfig();
final String serviceNameStr = config.getInitParameter(INIT_PARAM_NAME_SCHEDULER_SERVICE_NAME);
if (serviceNameStr == null) {
return null;
}
final ServiceNameEditor editor = new ServiceNameEditor();
editor.setAsText(serviceNameStr);
return (ServiceName) editor.getValue();
}
Aggregations