Package org.jboss.embedded.api.server

Examples of org.jboss.embedded.api.server.JBossASEmbeddedServer


      String bindAddress = System.getProperty("embedded.bind.address", "localhost");
     
      Thread.currentThread().setContextClassLoader(loader);

      JBossASEmbeddedServer server = JBossASEmbeddedServerFactory.createServer(loader);
      JBossASServerConfig config = server.getConfiguration();
      config.jbossHome(jbossHome);
      config.serverName(serverName);
      config.bindAddress(bindAddress);
      try
      {
         server.start();

         InitialContext context = new InitialContext();

         if(appName == null)
            server.deploy(deployments);
         else
         {
            // Create a virtual EAR with the correct name and add the given modules.
            /* If only...
            EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, appName);
            for(File d : deployments)
               archive.addModule(d);
            server.deploy(archive);
            */
            VirtualFileAssembly assembly = new VirtualFileAssembly(appName + ".ear");
            // make sure we don't have class loader isolation (else CCE in the user class)
            assembly.addDirectory("META-INF"); // make sure this is visible as a child
            assembly.add("META-INF/jboss-classloading.xml", createJBossClassLoadingXML());
            for(File d : deployments)
            {
               // if it's already a file it must not be mounted twice (see AbstractVFSArchiveStructureDeployer#determineStructure)
               if(d.isFile())
                  assembly.addZip(d.getName(), d);
               else
               {
                  // a whimsical hack to make sure the directory is marked as an expanded archive
                  String name = d.getName();
                  if(!name.endsWith(".jar"))
                     name = name + ".jar";
                  assembly.add(name, d);
               }
            }
            // Deploy the virtual EAR.
            server.deploy(assembly.getMountRoot().toURL());
         }

         return new JBossSubmersibleEJBContainer(server, context);
      }
      catch(Exception e)
View Full Code Here


    */
   public void setup(Context context, Configuration configuration)
   {
      JBossASContainerConfiguration containerConfiguration = configuration.getContainerConfig(JBossASContainerConfiguration.class);

      JBossASEmbeddedServer server = JBossASEmbeddedServerFactory.createServer();
      server.getConfiguration()
               .bindAddress(containerConfiguration.getBindAddress())
               .serverName(containerConfiguration.getProfileName());

      context.add(JBossASEmbeddedServer.class, server);
   }
View Full Code Here

    */
   public void setup(Context context, Configuration configuration)
   {
      JBossASContainerConfiguration containerConfiguration = configuration.getContainerConfig(JBossASContainerConfiguration.class);

      JBossASEmbeddedServer server = JBossASEmbeddedServerFactory.createServer();
      server.getConfiguration()
               .bindAddress(containerConfiguration.getBindAddress())
               .serverName(containerConfiguration.getProfileName());

      context.add(JBossASEmbeddedServer.class, server);
   }
View Full Code Here

TOP

Related Classes of org.jboss.embedded.api.server.JBossASEmbeddedServer

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.