Package org.jboss.bootstrap.spi

Examples of org.jboss.bootstrap.spi.ServerConfig


   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
   {
      // get server's home for relative paths, need this for setting
      // attribute final values, so we need to do it here
      ServerConfig serverConfig = ServerConfigLocator.locate();
      serverHome = serverConfig.getServerHomeDir();
      return super.preRegister(server, name);
   }
View Full Code Here


    * and registered to the jboss MBeanServer
    */
   private LibraryManager()
   {
      // discover if there is a local server library dir
      ServerConfig config = ServerConfigLocator.locate();
      URL serverLibURL = config.getServerLibraryURL();
     
      if (serverLibURL != null && serverLibURL.getProtocol().startsWith("file"))
      {
         this.serverLibDir = new File(serverLibURL.getFile());
         this.serverTmpDir = config.getServerTempDir();
         log.debug("Using serverLibDir: " + this.serverLibDir);
         log.debug("Using serverTmpDir: " + this.serverTmpDir);
      }
      else
      {
View Full Code Here

         ServiceControllerMBean.class,
         ServiceControllerMBean.OBJECT_NAME,
         server
      );

      ServerConfig config = ServerConfigLocator.locate();

      // build the scratch directory
      File tempDirectory = config.getServerTempDir();
      scratchDirectory = new File(tempDirectory, "foe");
      if(!scratchDirectory.exists())
         scratchDirectory.mkdirs();

      // Note: this should go the last.
View Full Code Here

      return createServer(name, configDir.toURL(), commonDir.toURL());
   }

   protected Server createServer(String name, URL configDir, URL commonDir)
   {
      ServerConfig config = new MockServerConfig(name, configDir, commonDir);
      return createServer(config);
   }
View Full Code Here

            return;
         }
      }

      // make sure we are initialized
      ServerConfig config = getConfig();

      // make sure we aren't started yet
      if (started)
         throw new IllegalStateException("already started");

      ClassLoader oldCL = Thread.currentThread().getContextClassLoader();

      try
      {
         ClassLoader myCL = getClass().getClassLoader();
         Thread.currentThread().setContextClassLoader(myCL);

         // See how long it takes us to start up
         StopWatch watch = new StopWatch(true);

         // Remember when we we started
         startDate = new Date();

         // Install the shutdown hook
         shutdownHook = new ShutdownHook();
         shutdownHook.setDaemon(true);
        
         try
         {
            Runtime.getRuntime().addShutdownHook(shutdownHook);
            if (log != null && log.isDebugEnabled())
            {
               log.debug("Shutdown hook added " + shutdownHook);
            }
         }
         catch (Exception e)
         {
            log.warn("Failed to add shutdown hook; ignoring", e);
         }

         // Do the main start
         doStart(watch);

         // TODO Fix the TCL hack used here!
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            // Run the bootstraps
            for (Bootstrap bootstrap : bootstraps)
            {
               Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
               startedBootstraps.add(0, bootstrap);
               bootstrap.start(this);
            }
         }
         finally
         {
            Thread.currentThread().setContextClassLoader(cl);
         }
        
         if (config.isInstallLifeThread())
         {
            lifeThread = new LifeThread();
            if (log != null && log.isDebugEnabled())
            {
               log.debug("Installing life thread " + lifeThread);
View Full Code Here

            {
               log.error("Failed to create BeanInfo for: "+serverComp, t);
            }
            // ServerConfig
            type = new ComponentType("MCBean", "ServerConfig");
            ServerConfig config = mcserver.getConfig();
            ManagedObject mo = mof.initManagedObject(config, null);
            ManagedComponentImpl configComp = new ManagedComponentImpl(type, firstDeployment, mo);
            firstDeployment.addComponent("ServerConfig", configComp);
            log.debug("Created ManagedComponent of type: "+type+" for ServerConfig");
         }
View Full Code Here

            return;
         }
      }

      // make sure we are initialized
      ServerConfig config = getConfig();

      // make sure we aren't started yet
      if (started)
         throw new IllegalStateException("already started");

      ClassLoader oldCL = Thread.currentThread().getContextClassLoader();

      try
      {
         ClassLoader myCL = getClass().getClassLoader();
         Thread.currentThread().setContextClassLoader(myCL);

         // See how long it takes us to start up
         StopWatch watch = new StopWatch(true);

         // Remember when we we started
         startDate = new Date();

         // Install the shutdown hook
         shutdownHook = new ShutdownHook();
         shutdownHook.setDaemon(true);
        
         try
         {
            Runtime.getRuntime().addShutdownHook(shutdownHook);
            log.debug("Shutdown hook added " + shutdownHook);
         }
         catch (Exception e)
         {
            log.warn("Failed to add shutdown hook; ignoring", e);
         }

         // Do the main start
         doStart(watch);

         // TODO Fix the TCL hack used here!
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         try
         {
            // Run the bootstraps
            for (Bootstrap bootstrap : bootstraps)
            {
               Thread.currentThread().setContextClassLoader(bootstrap.getClass().getClassLoader());
               startedBootstraps.add(0, bootstrap);
               bootstrap.start(this);
            }
         }
         finally
         {
            Thread.currentThread().setContextClassLoader(cl);
         }
        
         if (config.isInstallLifeThread())
         {
            lifeThread = new LifeThread();
            log.debug("Installing life thread " + lifeThread);
            lifeThread.start();
         }
View Full Code Here

    * @exception Exception if an error occurs
    */
   protected void createService() throws Exception
   {
      // get the temporary directories to use
      ServerConfig config = ServerConfigLocator.locate();
      tempNativeDir = config.getServerNativeDir();
      tempDeployDir = config.getServerTempDeployDir();
      loadNative = ServerConfigUtil.isLoadNative();

      // Setup the proxy to mainDeployer
      mainDeployer = (MainDeployerMBean)
         MBeanProxyExt.create(MainDeployerMBean.class,
View Full Code Here

      serviceController = (ServiceControllerMBean)
         MBeanProxyExt.create(ServiceControllerMBean.class,
            ServiceControllerMBean.OBJECT_NAME, server);

      // Get the data directory, install url & library url
      ServerConfig config = ServerConfigLocator.locate();
      dataDir = config.getServerDataDir();
      serverHomeURL = config.getServerHomeURL();
   }
View Full Code Here

    * (no jmx tag needed from superinterface)
    * @exception Exception if an error occurs
    */
   protected void createService() throws Exception
   {
      ServerConfig config = ServerConfigLocator.locate();
      // Get the temp directory location
      File basedir = config.getServerTempDir();
      // Set the local copy temp dir to tmp/deploy
      tempDir = new File(basedir, "deploy");
      // Delete any existing content
      Files.delete(tempDir);
      // Make sure the directory exists
View Full Code Here

TOP

Related Classes of org.jboss.bootstrap.spi.ServerConfig

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.