Tabnine Logo
BaseServiceUnitManager
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseServiceUnitManager
in
org.apache.servicemix.common

Best Java code snippets using org.apache.servicemix.common.BaseServiceUnitManager (Showing top 12 results out of 315)

origin: org.apache.servicemix/servicemix-camel

@Override
public BaseServiceUnitManager createServiceUnitManager() {
  Deployer[] deployers = new Deployer[] {new CamelSpringDeployer(this)};
  return new BaseServiceUnitManager(this, deployers);
}
origin: org.apache.servicemix/servicemix-common

public synchronized String deploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
  try {
    logger.debug("Deploying service unit");
    if (serviceUnitName == null || serviceUnitName.length() == 0) {
      throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
    }
    if (getServiceUnit(serviceUnitName) != null) {
      throw failure("deploy", "Service Unit '" + serviceUnitName + "' is already deployed", null);
    }
    ServiceUnit su = doDeploy(serviceUnitName, serviceUnitRootPath);
    if (su == null) {
      throw failure("deploy", "Unable to find suitable deployer for Service Unit '" + serviceUnitName + "'", null);
    }
    component.getRegistry().registerServiceUnit(su);
    logger.debug("Service unit deployed");
    return createSuccessMessage("deploy");
  } catch (DeploymentException e) {
    throw e;
  } catch (Exception e) {
    throw failure("deploy", "Unable to deploy service unit", e);
  }
}

origin: org.apache.servicemix/servicemix-common

public synchronized String undeploy(String serviceUnitName, String serviceUnitRootPath) throws DeploymentException {
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  try {
    logger.debug("Undeploying service unit");
    logger.debug("Shutting down service unit");
    if (serviceUnitName == null || serviceUnitName.length() == 0) {
      throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
    }
    ServiceUnit su = getServiceUnit(serviceUnitName);
    if (su == null) {
      throw failure("undeploy", "Service Unit '" + serviceUnitName + "' is not deployed", null);
    }
    if (!LifeCycleMBean.SHUTDOWN.equals(su.getCurrentState())) {
      throw failure("undeploy", "ServiceUnit should be in a SHUTDOWN state", null);
    }
    Thread.currentThread().setContextClassLoader(su.getConfigurationClassLoader());
    if (serviceUnitRootPath != null) {
      doUndeploy(su);
    }
    component.getRegistry().unregisterServiceUnit(su);
    logger.debug("Service unit undeployed");
    return createSuccessMessage("undeploy");
  } catch (DeploymentException e) {
    throw e;
  } catch (Exception e) {
    throw failure("undeploy", "Unable to undeploy service unit", e);
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}
origin: org.apache.servicemix/servicemix-common

public synchronized void shutDown(String serviceUnitName) throws DeploymentException {
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  try {
    logger.debug("Shutting down service unit");
    if (serviceUnitName == null || serviceUnitName.length() == 0) {
      throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
    }
    ServiceUnit su = getServiceUnit(serviceUnitName);
    if (su == null) {
      throw failure("shutDown", "Service Unit '" + serviceUnitName + "' is not deployed", null);
    }
    if (!LifeCycleMBean.STOPPED.equals(su.getCurrentState())) {
      throw failure("shutDown", "ServiceUnit should be in a STOPPED state", null);
    }
    Thread.currentThread().setContextClassLoader(su.getConfigurationClassLoader());
    su.shutDown();
    logger.debug("Service unit shut down");
  } catch (DeploymentException e) {
    throw e;
  } catch (Exception e) {
    throw failure("shutDown", "Unable to shutdown service unit", e);
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}
origin: org.apache.servicemix/servicemix-common

    throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
  ServiceUnit su = getServiceUnit(serviceUnitName);
  if (su == null) {
    if (!persistent) {
      su = doDeploy(serviceUnitName, serviceUnitRootPath);
      if (su == null) {
        throw failure("init", "Unable to find suitable deployer for Service Unit '" + serviceUnitName + "'", null);
      throw failure("init", "Service Unit '" + serviceUnitName + "' is not deployed", null);
    throw failure("init", "ServiceUnit should be in a SHUTDOWN state", null);
  throw e;
} catch (Exception e) {
  throw failure("init", "Unable to init service unit", e);
} finally {
  Thread.currentThread().setContextClassLoader(cl);
origin: org.apache.servicemix/servicemix-common

protected void doUndeploy(ServiceUnit su) throws Exception {
  for (int i = 0; i < deployers.length; i++) {
    if (deployers[i].canDeploy(su.getName(), su.getRootPath())) {
      deployers[i].undeploy(su);
      return;
    }
  }
  throw failure("undeploy", "Unable to find suitable deployer for Service Unit '" + su.getName() + "'", null);
}

origin: org.apache.servicemix/servicemix-common

public synchronized void stop(String serviceUnitName) throws DeploymentException {
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  try {
    logger.debug("Stopping service unit");
    if (serviceUnitName == null || serviceUnitName.length() == 0) {
      throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
    }
    ServiceUnit su = getServiceUnit(serviceUnitName);
    if (su == null) {
      throw failure("stop", "Service Unit '" + serviceUnitName + "' is not deployed", null);
    }
    if (!LifeCycleMBean.STARTED.equals(su.getCurrentState())) {
      throw failure("stop", "ServiceUnit should be in a STARTED state", null);
    }
    Thread.currentThread().setContextClassLoader(su.getConfigurationClassLoader());
    su.stop();
    logger.debug("Service unit stopped");
  } catch (DeploymentException e) {
    throw e;
  } catch (Exception e) {
    throw failure("stop", "Unable to stop service unit", e);
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}
origin: org.apache.servicemix/servicemix-camel

public BaseServiceUnitManager createServiceUnitManager() {
  CamelSpringDeployer deployer = new OsgiCamelSpringDeployer(this);
  return new BaseServiceUnitManager(this, new Deployer[] {deployer});
}
origin: org.apache.servicemix/servicemix-common

public synchronized void start(String serviceUnitName) throws DeploymentException {
  ClassLoader cl = Thread.currentThread().getContextClassLoader();
  try {
    logger.debug("Starting service unit");
    if (serviceUnitName == null || serviceUnitName.length() == 0) {
      throw new IllegalArgumentException("serviceUnitName should be non null and non empty");
    }
    ServiceUnit su = (ServiceUnit) getServiceUnit(serviceUnitName);
    if (su == null) {
      throw failure("start", "Service Unit '" + serviceUnitName + "' is not deployed", null);
    }
    if (!LifeCycleMBean.STOPPED.equals(su.getCurrentState())) {
      throw failure("start", "ServiceUnit should be in a STOPPED state", null);
    }
    Thread.currentThread().setContextClassLoader(su.getConfigurationClassLoader());
    su.start();
    logger.debug("Service unit started");
  } catch (DeploymentException e) {
    throw e;
  } catch (Exception e) {
    throw failure("start", "Unable to start service unit", e);
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}
origin: org.apache.servicemix/servicemix-jms

public BaseServiceUnitManager createServiceUnitManager() {
  Deployer[] deployers = new Deployer[] {new BaseXBeanDeployer(this, getEndpointClasses()), 
                      new JmsWsdl1Deployer(this)};
  return new BaseServiceUnitManager(this, deployers);
}
origin: org.apache.servicemix/servicemix-common

/**
 * Create the service unit manager.
 * Derived classes should override this method and return a
 * BaseServiceUnitManager so that the component is able to
 * handle service unit deployment.
 *
 * The default implementation will create a @{link BaseXBeanDeployer} instance
 * using the value of @{link #getEndpointClasses()} if that method returns a non-null value
 * otherwise it returns null.
 *
 * @return a newly created service unit manager
 */
protected BaseServiceUnitManager createServiceUnitManager() {
  Class[] classes = getEndpointClasses();
  if (classes == null) {
    return null;
  }
  Deployer[] deployers = new Deployer[] { new BaseXBeanDeployer(this, classes) };
  return new BaseServiceUnitManager(this, deployers);
}
origin: org.apache.servicemix/servicemix-http

public BaseServiceUnitManager createServiceUnitManager() {
  Deployer[] deployers = new Deployer[] {new BaseXBeanDeployer(this, getEndpointClasses()),
                      new HttpWsdl1Deployer(this)};
  return new BaseServiceUnitManager(this, deployers);
}
org.apache.servicemix.commonBaseServiceUnitManager

Javadoc

A simple service unit manager. This service unit manager uses Deployer objects to handle different type of service units.

Most used methods

  • <init>
  • createSuccessMessage
  • doDeploy
  • doUndeploy
  • failure
  • getServiceUnit

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Path (java.nio.file)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now