Package org.jboss.jbossas.servermanager

Examples of org.jboss.jbossas.servermanager.Server


   }

   @Override
   public void stop() throws LifecycleException
   {
      Server server = serverManager.getServer(configuration.getProfileName());
      if (!server.isRunning())
      {
         throw new LifecycleException("Can not stop server. Server is not started");
      }

      try
      {
         serverManager.stopServer(server.getName());
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not stop server", e);
      }
View Full Code Here


      return manager;
   }

   private Server createAndConfigureServer(JBossASConfiguration configuration)
   {
      Server server = new Server();
      server.setName(configuration.getProfileName());
      server.setHttpPort(configuration.getHttpPort());
      server.setRmiPort(configuration.getRmiPort());
      server.setHost(configuration.getBindAddress());
      server.setHasWebServer(!configuration.isUseRmiPortForAliveCheck());

      server.setUsername("admin");
      server.setPassword("admin");
     
      if (configuration.getPartition() != null) {
          server.setPartition(configuration.getPartition());
      }
      else {
          server.setPartition(Long.toHexString(System.currentTimeMillis()));
      }

      // Set server's JVM arguments
      setServerVMArgs(server, configuration.getJavaVmArguments());

      // Set server's system properties
      Property prop = new Property();
      prop.setKey("jbosstest.udp.ip_ttl");
      prop.setValue("0");
      server.addSysProperty(prop);
      prop = new Property();
      prop.setKey("java.endorsed.dirs");
      prop.setValue(new File(configuration.getJbossHome(), "lib/endorsed").getAbsolutePath());
      server.addSysProperty(prop);

      return server;
   }
View Full Code Here

   @Override
   public void start() throws LifecycleException
   {
      try
      {
         Server server = manager.getServer(configuration.getProfileName());
         if(ServerController.isServerStarted(server))
         {
            throw new LifecycleException(
                "The server is already running! " +
                "Managed containers does not support connecting to running server instances due to the " +
                "possible harmfull effect of connecting to the wrong server. Please stop server before running or " +
                "change to another type of container.");
         }
        
         manager.startServer(server.getName());
         initProfileService(server);
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not start remote container", e);
View Full Code Here

   }

   @Override
   public void stop() throws LifecycleException
   {
      Server server = manager.getServer(configuration.getProfileName());
     
      if(!server.isRunning())
      {
         throw new LifecycleException("Can not stop server. Server is not started");
      }
      try
      {
         removeFailedUnDeployments();
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not clean up failed undeployments", e);
      }
     
      try
      {
         manager.stopServer(server.getName());
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not stop server", e);
      }
View Full Code Here

      }
   }

   private void removeFailedUnDeployments() throws IOException
   {
      Server server = manager.getServer(configuration.getProfileName());
     
      List<String> remainingDeployments = new ArrayList<String>();
      for (String name : failedUndeployments)
      {
         try
         {
            server.undeploy(new File(name));
         }
         catch (Exception e)
         {
            IOException ioe = new IOException();
            ioe.initCause(e);
View Full Code Here

      return manager;
   }

   private Server createAndConfigureServer()
   {
      Server server = new Server();
      server.setName(configuration.getProfileName());
      server.setHttpPort(configuration.getHttpPort());
      server.setRmiPort(configuration.getRmiPort());
      server.setHost(configuration.getBindAddress());
      server.setHasWebServer(!configuration.isUseRmiPortForAliveCheck());
     
      server.setUsername("admin");
      server.setPassword("admin");
      server.setPartition(Long.toHexString(System.currentTimeMillis()));

      // Set server's JVM arguments
      setServerVMArgs(server, configuration.getJavaVmArguments());

      // Set server's system properties
      Property prop = new Property();
      prop.setKey("jbosstest.udp.ip_ttl");
      prop.setValue("0");
      server.addSysProperty(prop);
      prop = new Property();
      prop.setKey("java.endorsed.dirs");
      prop.setValue(new File(configuration.getJbossHome(), "lib/endorsed").getAbsolutePath());
      server.addSysProperty(prop);
     
      return server;
   }
View Full Code Here

   @Override
   public void start() throws LifecycleException
   {
      try
      {
         Server server = manager.getServer(configuration.getProfileName());
         if(ServerController.isServerStarted(server))
         {
            throw new LifecycleException(
                  "The server is already running! " +
                  "Managed containers does not support connecting to running server instances due to the " +
                  "possible harmfull effect of connecting to the wrong server. Please stop server before running or " +
                  "change to another type of container.");
         }
        
         manager.startServer(server.getName());
         initProfileService(server);
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not start remote container", e);
View Full Code Here

   }

   @Override
   public void stop() throws LifecycleException
   {
      Server server = manager.getServer(configuration.getProfileName());
      if(!server.isRunning())
      {
         throw new LifecycleException("Can not stop server. Server is not started");
      }
      try
      {
         removeFailedUnDeployments();
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not clean up failed undeployments", e);
      }
     
      try
      {
         manager.stopServer(server.getName());
      }
      catch (Exception e)
      {
         throw new LifecycleException("Could not stop server", e);
      }
View Full Code Here

      }
   }

   private void removeFailedUnDeployments() throws IOException
   {
      Server server = manager.getServer(configuration.getProfileName());
     
      List<String> remainingDeployments = new ArrayList<String>();
      for (String name : failedUndeployments)
      {
         try
         {
            server.undeploy(new File(name));
         }
         catch (Exception e)
         {
            IOException ioe = new IOException();
            ioe.initCause(e);
View Full Code Here

      return manager;
   }

   private Server createAndConfigureServer()
   {
      Server server = new Server();
      server.setName(configuration.getProfileName());
      server.setHttpPort(configuration.getHttpPort());
      server.setRmiPort(configuration.getRmiPort());
      server.setHost(configuration.getBindAddress());
      server.setHasWebServer(!configuration.isUseRmiPortForAliveCheck());
     
      server.setUsername("admin");
      server.setPassword("admin");
      server.setPartition(Long.toHexString(System.currentTimeMillis()));

      // Set server's JVM arguments
      setServerVMArgs(server, configuration.getJavaVmArguments());

      // Set server's system properties
      Property prop = new Property();
      prop.setKey("jbosstest.udp.ip_ttl");
      prop.setValue("0");
      server.addSysProperty(prop);
      prop = new Property();
      prop.setKey("java.endorsed.dirs");
      prop.setValue(new File(configuration.getJbossHome(), "lib/endorsed").getAbsolutePath());
      server.addSysProperty(prop);
     
      return server;
   }
View Full Code Here

TOP

Related Classes of org.jboss.jbossas.servermanager.Server

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.