@Override
 public Object getDelegate() {
   if (logEventInterceptor == null || resetRequested)
     logEventInterceptor =
         BeanContext.getFromJNDI(LogEventInterceptor.class, "LogEventInterceptor");
   return logEventInterceptor;
 }
Beispiel #2
0
 @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;
 }
 @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);
 }
 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();
 }
Beispiel #5
0
 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);
   }
 }
Beispiel #6
0
  // 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();
    //		}
  }
 @Override
 public EventLoggerContext getContext() {
   if (eventLoggerContext == null || resetRequested)
     eventLoggerContext = BeanContext.getFromJNDI(EventLoggerContext.class, "EventLoggerContext");
   return eventLoggerContext;
 }
 protected PackageTypeListManager getPackageTypeListManager() {
   return BeanContext.getFromSession("packageTypeListManager");
 }
 protected GraphicsHelper getGraphicsHelper() {
   return BeanContext.getFromSession("graphicsHelper");
 }
 public void cancelGraphics() {
   BeanContext.removeFromSession("graphics");
   graphicsPageManager.removeContext(graphicsWizard);
 }
Beispiel #11
0
 public boolean isInitialized(String moduleId) {
   Initializer initializer = BeanContext.get(moduleId + ".initializer");
   if (initializer != null) return true;
   return false;
 }
 public void initializeView(String elementType, String viewTitle, String sectionName) {
   String pageManagerName = NameUtil.uncapName(elementType) + "PageManager";
   PageManager<?> pageManager = BeanContext.getFromSession(pageManagerName);
   initializeView(pageManager, viewTitle, sectionName);
 }
Beispiel #13
0
 public DataModel<ImportListObject> getImports(Collection<Import> importsList) {
   ImportListManager importListManager = BeanContext.getFromSession("importListManager");
   DataModel<ImportListObject> dataModel = importListManager.getDataModel(importsList);
   return dataModel;
 }