コード例 #1
0
 @Override
 public Object getDelegate() {
   if (logEventInterceptor == null || resetRequested)
     logEventInterceptor =
         BeanContext.getFromJNDI(LogEventInterceptor.class, "LogEventInterceptor");
   return logEventInterceptor;
 }
コード例 #2
0
ファイル: UnitConverter.java プロジェクト: tfisher1226/ARIES
 @Override
 public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String value) {
   if (StringUtils.isEmpty(value)) return null;
   UnitListManager unitListManager = BeanContext.getFromSession("unitListManager");
   Unit unit = unitListManager.getRecordByName(value);
   return unit;
 }
コード例 #3
0
 @Begin(join = true)
 public void newRegistration() {
   setTitle("New Registration");
   Messages messages = BeanContext.get("messages");
   messages.info("Registration", "Enter information for new Registration.");
   registration = new Registration();
   // registration.setUserId(value);
   registrationManager.initialize(registration);
   initialize(registration);
 }
コード例 #4
0
 public void setUp() throws Exception {
   mockInitializer = mock(Initializer.class);
   mockPropertyManager = mock(PropertyManager.class);
   mockNotificationDispatcher = mock(NotificationDispatcher.class);
   mockTransactionRegistryManager = mock(TransactionRegistryManager.class);
   mockTransactionParticipantManager = mock(TransactionParticipantManager.class);
   mockTransactionSynchronizationRegistry = mock(TransactionSynchronizationRegistry.class);
   BeanContext.set(getModule() + ".initializer", mockInitializer);
   BeanContext.set(getModule() + ".propertyManager", mockPropertyManager);
   BeanContext.set(getDomain() + ".notificationDispatcher", mockNotificationDispatcher);
   BeanContext.set(getDomain() + ".jaxbSessionCache", new JAXBSessionCache(getDomain()));
   if (getMockServiceContext() != null)
     FieldUtil.setFieldValue(
         getMockServiceContext(), "transactionRegistryManager", mockTransactionRegistryManager);
   when(mockPropertyManager.get("aries.port.rmi")).thenReturn("1098");
   MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer();
   MBeanUtil.setMBeanServer(mbeanServer);
   setGlobalTransactionActive(false);
   super.setUp();
 }
コード例 #5
0
ファイル: Bootstrap.java プロジェクト: tfisher1226/ARIES
 public void initializeFrameworkComponents() throws Exception {
   if (!initialized.get()) {
     if (BeanContext.get(domainName + ".proxyLocator") == null)
       BeanContext.set(domainName + ".proxyLocator", new ProxyLocator());
     if (BeanContext.get(domainName + ".jaxbSessionCache") == null)
       BeanContext.set(domainName + ".jaxbSessionCache", new JAXBSessionCache(domainName));
     if (BeanContext.get(domainName + ".namespaceContext") == null)
       BeanContext.set(domainName + ".namespaceContext", new NamespaceContext(domainName));
     if (BeanContext.get("org.aries.processRegistry") == null)
       BeanContext.set("org.aries.processRegistry", new ProcessRegistry());
     if (BeanContext.get("org.aries.processLocator") == null)
       BeanContext.set("org.aries.processLocator", new ProcessLocator());
     if (BeanContext.get("org.aries.serviceFactory") == null)
       BeanContext.set("org.aries.serviceFactory", new ServiceFactoryImpl());
     if (BeanContext.get("org.aries.serviceRepository") == null)
       BeanContext.set("org.aries.serviceRepository", new ServiceRepositoryImpl());
     if (BeanContext.get("org.aries.serviceRegistry") == null)
       BeanContext.set("org.aries.serviceRegistry", new ServiceRegistry());
     if (BeanContext.get("org.aries.serviceLocator") == null)
       BeanContext.set("org.aries.serviceLocator", new ServiceLocator());
     if (BeanContext.get("org.aries.serviceProxyFactory") == null)
       BeanContext.set("org.aries.serviceProxyFactory", new ServiceProxyFactory());
     if (BeanContext.get("org.aries.linkStateRegistry") == null)
       BeanContext.set("org.aries.linkStateRegistry", new LinkStateRegistry());
     if (BeanContext.get("org.aries.executorService") == null)
       BeanContext.set("org.aries.executorService", Executors.newFixedThreadPool(10));
     TaskInvokerFactory taskInvokerFactory = new TaskInvokerFactory();
     TaskExecutorFactory taskExecutorFactory = new TaskExecutorFactory();
     taskInvokerFactory.setTaskInvokerClassName("org.aries.task.TaskInvokerImpl");
     taskExecutorFactory.setTaskExecutorClassName("common.tx.util.TaskExecutorImpl");
     if (BeanContext.get("org.aries.invokerFactory") == null)
       BeanContext.set("org.aries.invokerFactory", taskInvokerFactory);
     if (BeanContext.get("org.aries.executorFactory") == null)
       BeanContext.set("org.aries.executorFactory", taskExecutorFactory);
     if (BeanContext.get("org.aries.providerCache") == null)
       BeanContext.set("org.aries.providerCache", new ProviderCache());
     initialized.set(true);
   }
 }
コード例 #6
0
ファイル: Bootstrap.java プロジェクト: tfisher1226/ARIES
  // TODO rename runtime location to tempFileLocation
  public void initializePropertyManager() throws Exception {
    // Establish working location
    if (workingLocation == null) workingLocation = DEFAULT_WORKING_LOCATION;
    workingLocation = FileUtil.normalizePath(workingLocation);
    log.info("Application working Location: " + workingLocation);

    // Establish application home
    Assert.notNull(applicationHome, "Application home location must be specified");
    applicationHome = FileUtil.normalizePath(applicationHome);
    log.info("Application home location: " + applicationHome);

    // Establish runtime location
    // if (runtimeLocation == null)
    runtimeLocation = applicationHome;
    runtimeLocation = FileUtil.normalizePath(runtimeLocation);
    log.info("Application runtime location: " + runtimeLocation);

    // Establish cache location
    // if (cacheLocation == null)
    cacheLocation = applicationHome + "/cache";
    cacheLocation = FileUtil.normalizePath(cacheLocation);
    log.info("Application cache location: " + cacheLocation);

    // Establish property location
    propertyLocation = establishGlobalPropertyLocation(applicationHome);
    log.info("Application runtime property Location: " + propertyLocation);
    propertyLocation = FileUtil.normalizePath(propertyLocation);

    //		File sourceLocation = new File(runtimeLocation + "/model");
    //		Set<String> subFolders = ImportUtil.getImportedFileFolders(sourceLocation);
    //		Iterator<String> iterator = subFolders.iterator();
    //		while (iterator.hasNext()) {
    //			String subFolder = iterator.next();
    //			PropertyInitializer propertyInitializer = new PropertyInitializer();
    //			propertyInitializer.setRuntimeLocation(runtimeLocation);
    //			propertyInitializer.setWorkingLocation(workingLocation);
    //			propertyInitializer.setPropertyLocation(propertyLocation);
    //			if (!subFolder.startsWith("/model"))
    //				subFolder = "/model" + subFolder;
    //			propertyInitializer.setSubFolder(subFolder);
    //			propertyInitializer.initialize();
    //
    //		}

    // TODO establish source and target property locations per module
    PropertyInitializer propertyInitializer = new PropertyInitializer();
    propertyInitializer.setRuntimeLocation(runtimeLocation);
    propertyInitializer.setWorkingLocation(workingLocation);
    propertyInitializer.setPropertyLocation(propertyLocation);
    propertyInitializer.initialize();

    String propertyManagerKey = getModuleName() + ".propertyManager";
    PropertyManager propertyManager = BeanContext.get(propertyManagerKey);
    if (propertyManager == null) propertyManager = new PropertyManager();
    // BeanContext.set("org.aries.propertyManager", propertyManager);
    BeanContext.set(propertyManagerKey, propertyManager);
    propertyManager.setPropertyLocation(propertyLocation);
    propertyManager.initialize();

    Object object1 = propertyManager.get("bookshop2.shipper.transport");
    Object object2 = propertyManager.get("bookshop2.supplier.transport");
    System.out.println();

    //		ServletContext servletContext = RuntimeContext.getInstance().getServletContext();
    //		if (servletContext != null) {
    //			propertyInitializer.initialize(servletContext);
    //		} else {
    //			propertyInitializer.initialize();
    //		}
  }
コード例 #7
0
 @Override
 public EventLoggerContext getContext() {
   if (eventLoggerContext == null || resetRequested)
     eventLoggerContext = BeanContext.getFromJNDI(EventLoggerContext.class, "EventLoggerContext");
   return eventLoggerContext;
 }
コード例 #8
0
 protected PackageTypeListManager getPackageTypeListManager() {
   return BeanContext.getFromSession("packageTypeListManager");
 }
コード例 #9
0
 protected GraphicsHelper getGraphicsHelper() {
   return BeanContext.getFromSession("graphicsHelper");
 }
コード例 #10
0
 public void cancelGraphics() {
   BeanContext.removeFromSession("graphics");
   graphicsPageManager.removeContext(graphicsWizard);
 }
コード例 #11
0
ファイル: JmsListener.java プロジェクト: tfisher1226/ARIES
 public boolean isInitialized(String moduleId) {
   Initializer initializer = BeanContext.get(moduleId + ".initializer");
   if (initializer != null) return true;
   return false;
 }
コード例 #12
0
 public void initializeView(String elementType, String viewTitle, String sectionName) {
   String pageManagerName = NameUtil.uncapName(elementType) + "PageManager";
   PageManager<?> pageManager = BeanContext.getFromSession(pageManagerName);
   initializeView(pageManager, viewTitle, sectionName);
 }
コード例 #13
0
 public DataModel<ImportListObject> getImports(Collection<Import> importsList) {
   ImportListManager importListManager = BeanContext.getFromSession("importListManager");
   DataModel<ImportListObject> dataModel = importListManager.getDataModel(importsList);
   return dataModel;
 }