Examples of ServiceManager


Examples of com.foundationdb.server.service.ServiceManager

    /** Construct for given index and context */
    public FullTextQueryBuilder(FullTextIndex index, AkibanInformationSchema ais,
                                QueryContext buildContext) {
        this.indexName = index.getIndexName();
        ServiceManager serviceManager = null;
        if (buildContext != null) {
            try {
                serviceManager = buildContext.getServiceManager();
            }
            catch (UnsupportedOperationException ex) {
            }
        }
        if (serviceManager != null) {
            this.infos = serviceManager.getServiceByClass(FullTextIndexService.class);
        }
        else {
            this.infos = new TestFullTextIndexInfos(ais);
        }
        this.buildContext = buildContext;
View Full Code Here

Examples of com.google.common.util.concurrent.ServiceManager

        // register node by initiating first ping. if the node isn't registered, loading persisted inputs will fail silently, for example
        Ping.Pinger pinger = injector.getInstance(Ping.Pinger.class);
        pinger.ping();

        final ServiceManager serviceManager = injector.getInstance(ServiceManager.class);
        final ServiceManagerListener serviceManagerListener = injector.getInstance(ServiceManagerListener.class);
        serviceManager.addListener(serviceManagerListener);
        serviceManager.startAsync().awaitHealthy();

        LOG.info("Graylog2 Radio up and running.");

        while (true) {
            try { Thread.sleep(1000); } catch (InterruptedException e) { /* lol, i don't care */ }
View Full Code Here

Examples of com.google.common.util.concurrent.ServiceManager

    Set<Service> services;

    @Override
    public ServiceManager get() {
        LOG.debug("Using services: {}", services);
        return new ServiceManager(services);
    }
View Full Code Here

Examples of com.google.common.util.concurrent.ServiceManager

        // Le server object. This is where all the magic happens.
        final ServerStatus serverStatus = injector.getInstance(ServerStatus.class);
        serverStatus.initialize();

        ActivityWriter activityWriter = null;
        ServiceManager serviceManager = null;
        try {
            activityWriter = injector.getInstance(ActivityWriter.class);
            serviceManager = injector.getInstance(ServiceManager.class);
        } catch (ProvisionException e) {
            for (Message message : e.getErrorMessages()) {
                if (message.getCause() instanceof MongoException) {
                    LOG.error(UI.wallString("Unable to connect to MongoDB. Is it running and the configuration correct?"));
                    System.exit(-1);
                }
            }

            LOG.error("Guice error", e);
            System.exit(-1);
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
            System.exit(-1);
        }

        final ActivityWriter finalActivityWriter = activityWriter;
        final ServiceManager finalServiceManager = serviceManager;
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                String msg = "SIGNAL received. Shutting down.";
                LOG.info(msg);
                finalActivityWriter.write(new Activity(msg, Main.class));

                GracefulShutdown shutdown = injector.getInstance(GracefulShutdown.class);
                shutdown.runWithoutExit();
                finalServiceManager.stopAsync().awaitStopped();
            }
        });

        // Register this node.
        final NodeService nodeService = injector.getInstance(NodeService.class);
View Full Code Here

Examples of com.sun.faban.harness.services.ServiceManager

                logger.log(Level.SEVERE, "Run configuration failed!", t);
                return;
            }

            // Deal with the services.
            serviceMgr = new ServiceManager(par, run);
            logger.fine("Got Service Manager Instance");
            // transfer service configuration.
            serviceMgr.configure();
            logger.fine("Executed services configure method");
            // start services
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.service.ServiceManager

     @throws IllegalStateException if the broker is already stopped
     *
     */
    public JMSService getJMSService()
      throws IllegalStateException  {
  ServiceManager sm = Globals.getServiceManager();
  JMSService jmsService = getJMSService(DEFAULT_DIRECTMODE_SERVICE_NAME);

  if (jmsService != null)  {
      return (jmsService);
  }

  /*
   * If "jmsdirect" is not available, loop through all services
   */
  List serviceNames = sm.getAllServiceNames();
  Iterator iter = serviceNames.iterator();

  while (iter.hasNext())  {
      jmsService = getJMSService((String)iter.next());

View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.service.ServiceManager

     *
     *  @throws IllegalStateException if the broker is already stopped
     */
    public JMSService getJMSService(String serviceName)
        throws IllegalStateException  {
  ServiceManager sm = Globals.getServiceManager();
  Service svc;
  IMQService imqSvc;
  IMQDirectService imqDirectSvc;

  if (sm == null)  {
      return (null);
  }

  svc = sm.getService(serviceName);

  if (svc == null)  {
      return (null);
  }

View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.service.ServiceManager

  super(parent);
    }

    public static ServiceInfo getServiceInfo(String name) {

        ServiceManager sm = Globals.getServiceManager();
        ConnectionManager cm = Globals.getConnectionManager();
  MetricManager mm = Globals.getMetricManager();

        /* XXX REVISIT dipol 10/17/00 we should probably put this logic
         * into the ServiceManager so knowledge of property names
         * is encapsulated there.
         */
        String proto = props.getProperty(SERVICE_PREFIX +
            name + ".protocoltype");

        // Fill in admin service info object
  ServiceInfo si = new com.sun.messaging.jmq.util.admin.ServiceInfo();
  si.name = name;
  si.protocol = proto;

        // strange kludge here ...
        // if protocol is tcp or tls, it defaults to 0
        int default_value=-1;
  if (si.protocol != null)  {
            if (si.protocol.equals("tcp") || si.protocol.equals("tls"))
                default_value = 0;
  }

        si.port = props.getIntProperty(SERVICE_PREFIX +
            name + "." + proto + ".port", default_value);

        if (si.port == 0) {
            si.dynamicPort = true;
        } else {
            si.dynamicPort = false;
        }

        si.minThreads = props.getIntProperty(SERVICE_PREFIX + name + ".min_threads");
        si.maxThreads = props.getIntProperty(SERVICE_PREFIX + name + ".max_threads");

        si.type = sm.getServiceType(name);

        Service service = sm.getService(name);
       
        if (service != null) {
            si.nConnections = cm.getNumConnections(service);
            si.state = service.getState();

View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.service.ServiceManager

        int status = Status.OK;
  String errMsg = null;

  String service = (String)cmd_props.get(MessageType.JMQ_SERVICE_NAME);

  ServiceManager sm = Globals.getServiceManager();
  ConnectionManager cm = Globals.getConnectionManager();

        // Get the list of service names from the ServiceManager
  List serviceNames = sm.getAllServiceNames();

        // Iterate through services
  Vector v = new Vector();
  Iterator iter = serviceNames.iterator();
  while (iter.hasNext()) {
View Full Code Here

Examples of com.sun.messaging.jmq.jmsserver.service.ServiceManager

    // This string is also hardcoded in
    // com.sun.messaging.jmq.jmsserver.management.mbeans.BrokerConfig.hasDirectConnections() and
    // com.sun.messaging.jmq.jmsserver.data.handlers.admin.ShutdownHandler.hasDirectConnections()
      String DEFAULT_DIRECTMODE_SERVICE_NAME = "jmsdirect";
       
    ServiceManager sm = Globals.getServiceManager();
    JMSService jmsService = getJMSService(DEFAULT_DIRECTMODE_SERVICE_NAME);

    if (jmsService != null)  {
        return (jmsService);
    }

    /*
     * If "jmsdirect" is not available, loop through all services
     */
    List serviceNames = sm.getAllServiceNames();
    Iterator iter = serviceNames.iterator();

    while (iter.hasNext())  {
        jmsService = getJMSService((String)iter.next());

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.