Package org.apache.openejb.assembler.classic

Examples of org.apache.openejb.assembler.classic.Assembler


        super.setUp();

        System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, InitContextFactory.class.getName());

        ConfigurationFactory config = new ConfigurationFactory();
        Assembler assembler = new Assembler();

        assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
        assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
        assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));

        // containers
        StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
        statelessContainerInfo.properties.setProperty("TimeOut", "10");
        statelessContainerInfo.properties.setProperty("PoolSize", "0");
        statelessContainerInfo.properties.setProperty("StrictPooling", "false");
        assembler.createContainer(statelessContainerInfo);

        // Setup the descriptor information

        StatelessBean bean = new StatelessBean(WidgetBean.class);
        bean.addBusinessLocal(Widget.class.getName());
        bean.addBusinessRemote(RemoteWidget.class.getName());

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(bean);

        assembler.createApplication(config.configureApplication(ejbJar));

    }
View Full Code Here


        Properties initProps = new Properties();
        initProps.setProperty("openejb.deployments.classpath.include", "");
        initProps.setProperty("openejb.deployments.classpath.filter.descriptors", "true");
        OpenEJB.init(initProps, new ServerFederation());

        Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
        ConfigurationFactory config = new ConfigurationFactory();

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(Target.class));
        assembler.createApplication(config.configureApplication(ejbJar));


        MulticastDiscoveryAgent multicastAgent = new MulticastDiscoveryAgent();
        DiscoveryRegistry registry = new DiscoveryRegistry(multicastAgent);
        SystemInstance.get().setComponent(DiscoveryRegistry.class, registry);
View Full Code Here

        ServiceDaemon serviceDaemon = new ServiceDaemon(ejbServer, 0, "localhost");
        serviceDaemon.start();

        int port = serviceDaemon.getPort();

        Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
        ConfigurationFactory config = new ConfigurationFactory();

        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean("Orange", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Apple", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Peach", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Pear", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("Plum", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Orange", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Apple", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Peach", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Pear", Fruit.class));
        ejbJar.addEnterpriseBean(new StatelessBean("ejb/Plum", Fruit.class));
        assembler.createApplication(config.configureApplication(ejbJar));

        try {

            // good creds
            Properties props = new Properties();
View Full Code Here

            throw new NullPointerException("transactionManager is null");
        }

        boolean offline = true;
        configurationFactory = new ConfigurationFactory(offline);
        assembler = new Assembler();

        // install application server
        ApplicationServer applicationServer = new ServerFederation();
        SystemInstance.get().setComponent(ApplicationServer.class, applicationServer);
View Full Code Here

            throw new NullPointerException("transactionManager is null");
        }

        boolean offline = true;
        configurationFactory = new ConfigurationFactory(offline);
        assembler = new Assembler();

        // install application server
        ApplicationServer applicationServer = new ServerFederation();
        SystemInstance.get().setComponent(ApplicationServer.class, applicationServer);
View Full Code Here

        setDefaultProperty("openejb.jndiname.failoncollision", "false");

//        System.setProperty("openejb.naming", "xbean");
        boolean offline = true;
        configurationFactory = new ConfigurationFactory(offline);
        assembler = new Assembler(openejbContext.newJndiFactory());

        // install application server
        ApplicationServer applicationServer = new ServerFederation();
        SystemInstance.get().setComponent(ApplicationServer.class, applicationServer);
View Full Code Here

      OpenEjbVersion.get();
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }
   
    Assembler a = new Assembler();
    TransactionServiceInfo tsi = new TransactionServiceInfo();
    tsi.service = "TransactionManager";
    tsi.id = "OSGi Transaction Manager";
    PassthroughFactory.add(tsi, OSGiTransactionManager.get());
    //Avoid another ClassLoader problem
    try {
      Thread.currentThread().setContextClassLoader(PassthroughFactory.class.getClassLoader());
      a.createTransactionManager(tsi);
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }
   
    try {
      //Overwrite existing, default JPA integration with an Aries JPA integrated one
      Assembler.getContext().put(JtaEntityManagerRegistry.class.getName(),
          AriesPersistenceContextIntegration.get());
      SystemInstance.get().setComponent(JtaEntityManagerRegistry.class,
          AriesPersistenceContextIntegration.get());
    } catch (NoClassDefFoundError ncdfe) {
      //TODO log that no JPA Context integration is available
    }
   
    SecurityServiceInfo ssi = new SecurityServiceInfo();
    ssi.service = "SecurityService";
    ssi.id = "Pseudo Security Service";
    PassthroughFactory.add(ssi, new PseudoSecurityService());
    //Avoid another ClassLoader problem
    try {
      Thread.currentThread().setContextClassLoader(PassthroughFactory.class.getClassLoader());
      a.createSecurityService(ssi);
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }
   
   
    ProxyFactoryInfo proxyFactoryInfo = new ProxyFactoryInfo();
    proxyFactoryInfo.id = "Aries ProxyFactory";
    proxyFactoryInfo.service = "ProxyFactory";
    proxyFactoryInfo.properties = new Properties();
    PassthroughFactory.add(proxyFactoryInfo, AriesProxyService.get());
    try {
      Thread.currentThread().setContextClassLoader(PassthroughFactory.class.getClassLoader());
      a.createProxyFactory(proxyFactoryInfo);
    } finally {
      Thread.currentThread().setContextClassLoader(cl);
    }
  }
View Full Code Here

      }
     
      processJPAMappings(ejbInfo);
     
     
      Assembler assembler = (Assembler) SystemInstance.get().getComponent(Assembler.class);
      RunningApplication app = null;
      try {
        SystemInstance.get().setProperty("openejb.geronimo", "true");
        cl = Thread.currentThread().getContextClassLoader();
        try {
          Thread.currentThread().setContextClassLoader(OpenEjbVersion.class.getClassLoader());
          app = new RunningApplication(assembler.createApplication(ejbInfo,
              new AppClassLoader(ejbModule.getClassLoader())), bundle, ejbInfo.enterpriseBeans);
        } finally {
          Thread.currentThread().setContextClassLoader(cl);
        }
      } finally {
View Full Code Here

    else {
      try {
        RunningApplication app = runningApps.remove(bundle);
        if(app != null) {
          app.destroy();
          Assembler assembler = (Assembler) SystemInstance.get().getComponent(Assembler.class);
          assembler.destroyApplication(app.getCtx());
        }
      } catch (OpenEJBException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } finally {
View Full Code Here

//        System.setProperty("openejb.naming", "xbean");
        boolean offline = true;
        configurationFactory = new ConfigurationFactory(offline);
        final XBeanJndiFactory jndiFactory = new XBeanJndiFactory();
        assembler = new Assembler(jndiFactory);

        // install application server
        ApplicationServer applicationServer = new ServerFederation();
        SystemInstance.get().setComponent(ApplicationServer.class, applicationServer);
View Full Code Here

TOP

Related Classes of org.apache.openejb.assembler.classic.Assembler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.