Package com.sun.messaging.jmq.util.admin

Examples of com.sun.messaging.jmq.util.admin.ServiceInfo


        Enumeration e = bSvclCObj.children();
        while (e.hasMoreElements()) {
            BrokerServiceCObj bSvcCObj = (BrokerServiceCObj)e.nextElement();
            for (int i = 0; i < svcs.size(); i++) {
                ServiceInfo svc = (ServiceInfo)svcs.elementAt(i);
                if ((bSvcCObj.getServiceInfo().name).equals(svc.name))
                    bSvcCObj.setServiceInfo((ServiceInfo)svcs.elementAt(i));
            }
        }
    }
View Full Code Here


         */
        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
View Full Code Here

  Iterator iter = serviceNames.iterator();
  while (iter.hasNext()) {
            String name = (String)iter.next();

            if (service == null) {
          ServiceInfo si = getServiceInfo(name);
          v.add(si);
            } else if (service.equals(name)) {
          ServiceInfo si = getServiceInfo(name);
          v.add(si);
                break;
            }
  }
View Full Code Here

        if ( DEBUG ) {
            logger.log(Logger.DEBUG, this.getClass().getName() + ": " +
                cmd_props);
        }

  ServiceInfo info = (ServiceInfo)getBodyObject(cmd_msg);
        int status = Status.OK;
        String errMsg = null;

  ServiceManager sm = Globals.getServiceManager();
        Service svc = null;

        HAMonitorService hamonitor = Globals.getHAMonitorService();
        if (hamonitor != null && hamonitor.inTakeover()) {
            status = Status.ERROR;
            errMsg =  rb.getString(rb.E_CANNOT_PROCEED_TAKEOVER_IN_PROCESS);

            logger.log(Logger.ERROR, this.getClass().getName() + ": " + errMsg);
  } else  {
        if (info.name == null || ((svc= sm.getService(info.name)) == null)) {
            status = Status.ERROR;
            errMsg = rb.getString( rb.X_NO_SUCH_SERVICE,
                (info.name == null ? "<null>" : info.name));
        }
        }

        // OK .. set the service information
        if (status == Status.OK) {
            if (! (svc instanceof IMQService)) {
                status = Status.ERROR;
                errMsg = "Internal Error: can updated non-standard Service";
            } else {
            // XXX - really we want to do this through properties, I need
            // to repair this by fcs
                try {
                    IMQService stsvc = (IMQService)svc;
                    int port = -1;
                    int min = -1;
                    int max = -1;
                    if (info.isModified(info.PORT)) {
                        port = info.port;
                    }
                    if (info.isModified(info.MIN_THREADS)) {
                        min = info.minThreads;
                    }
                    if (info.isModified(info.MAX_THREADS)) {
                        max = info.maxThreads;
                    }
                    if (port != -1 || min !=-1 || max != -1) {
                        stsvc.updateService(port, min, max);
                    } else {
View Full Code Here

   */
  for (java.util.Enumeration e = bSvcListCObj.children();
    e.hasMoreElements();) {
      ConsoleObj node = (ConsoleObj)e.nextElement();
      if (node instanceof BrokerServiceCObj) {
    ServiceInfo svcInfo = ((BrokerServiceCObj)node).getServiceInfo();
    if (svcInfo != null &&
        svcInfo.type != ServiceType.ADMIN &&
        svcInfo.state == ServiceState.RUNNING) {
        answer = true;
        break;
View Full Code Here

   */
  for (java.util.Enumeration e = bSvcListCObj.children();
    e.hasMoreElements();) {
      ConsoleObj node = (ConsoleObj)e.nextElement();
      if (node instanceof BrokerServiceCObj) {
    ServiceInfo svcInfo = ((BrokerServiceCObj)node).getServiceInfo();
    if (svcInfo != null &&
        svcInfo.type != ServiceType.ADMIN &&
        svcInfo.state == ServiceState.PAUSED) {
        answer = true;
        break;
View Full Code Here

import com.sun.messaging.jms.management.server.MQObjectName;

public class ServiceUtil {
    public static ServiceInfo getServiceInfo(String service)  {
  ServiceInfo si = GetServicesHandler.getServiceInfo(service);

  return (si);
    }
View Full Code Here

        while (iter.hasNext()) {
            String service = (String)iter.next();
      /*
            System.out.println("\t" + service);
      */
      ServiceInfo sInfo = GetServicesHandler.getServiceInfo(service);
      al.add(sInfo);
        }

  return (al);
    }
View Full Code Here

        row[2] = ar.getString(ar.I_JMQCMD_SVC_STATE);
        bcp.addTitle(row);
 
                    Enumeration thisEnum = svcs.elements();
                    while (thisEnum.hasMoreElements()) {
                        ServiceInfo sInfo = (ServiceInfo)thisEnum.nextElement();
                        row[0] = sInfo.name;

      // The port number is not applicable to this service
      if (sInfo.port == -1) {
          row[1] = "-";
View Full Code Here

                Globals.stdErrPrintln(ar.getString(ar.I_JMQCMD_UPDATE_BKR_FAIL));
          return (1);
      }

        } else if (CMDARG_SERVICE.equals(commandArg)) {
      ServiceInfo  si;
      String svcName;

      if (broker == null)  {
                Globals.stdErrPrintln(ar.getString(ar.I_JMQCMD_UPDATE_SVC_FAIL));
          return (1);
      }

            if (!force)
                broker = promptForAuthentication(broker);

      targetAttrs = brokerCmdProps.getTargetAttrs();
      svcName = brokerCmdProps.getTargetName();
            Globals.stdOutPrintln(ar.getString(ar.I_JMQCMD_UPDATE_SVC, svcName));
      Globals.stdOutPrintln("");
      printAttrs(targetAttrs);

      Globals.stdOutPrintln(ar.getString(ar.I_JMQCMD_SPECIFY_BKR));
      printBrokerInfo(broker);

            si = getServiceInfoFromAttrs(targetAttrs);
            si.setName(svcName);

      /*
       * Get the svcPort value.
       */
      int svcType = -1;
      int svcPort = -1;

      Vector svc = null;
      try {
                connectToBroker(broker);

                broker.sendGetServicesMessage(svcName);
                svc = broker.receiveGetServicesReplyMessage();

                if ((svc != null) && (svc.size() == 1)) {
                    Enumeration thisEnum = svc.elements();
                    ServiceInfo sInfo = (ServiceInfo)thisEnum.nextElement();
        svcType = sInfo.type;
        svcPort = sInfo.port;
          }
      } catch (BrokerAdminException bae) {
                handleBrokerAdminException(bae);
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.util.admin.ServiceInfo

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.