Package com.sun.messaging.jmq.jmsserver.config

Examples of com.sun.messaging.jmq.jmsserver.config.BrokerConfig


  return (getHostname());
    }

    public static boolean getHAEnabled() {
        if (HAEnabled == null) {
            BrokerConfig conf = Globals.getConfig();
            boolean isHA = conf.getBooleanProperty(Globals.HA_ENABLED_PROPERTY, false);
            String clusterID = conf.getProperty(Globals.CLUSTERID_PROPERTY);
            if (isHA) {
                if (clusterID == null || clusterID.length() == 0) {
                    throw new RuntimeException(
                        Globals.getBrokerResources().getKString(
                            BrokerResources.X_CID_MUST_BE_SET_HA));
View Full Code Here


    public static BrokerConfig getConfig() {
        if (config == null) {
            synchronized (lock) {
                if (config == null) {
                    try {
                        config = new BrokerConfig(configName, parameters, clearProps, saveProps);
                    } catch (BrokerException ex) {
                        getLogger().logStack(Logger.ERROR, "Internal Error: Unable to load broker, configuration properties are not available. Exiting", ex.getCause());
                        Broker.getBroker().exit(-1,
                            "Internal Error: Unable to load broker,"
                            + " configuration properties are not available. Exiting",
View Full Code Here

  String    protocol = null,
      urlpath = null,
      jmxurl = null;
  int    port = 0;
  JMXServiceURL  url;
        BrokerConfig  config = Globals.getConfig();
        String          jmxHostname = Globals.getJMXHostname();

  if (configuredURL != null)  {
      return;
  }

  jmxurl = config.getProperty(CONNECTOR_PROPBASE
      + name + URL_SUFFIX);

  if (jmxurl == null)  {
      protocol = config.getProperty(CONNECTOR_PROPBASE
          +  name + PROTOCOL_SUFFIX, "rmi");
      /*
       * Get port value, defaulting to 0 if none was specified.
       *
       * The javadoc for JMXServiceURL says that getPort() will return
       * 0 if none was specified.
       */
      port = config.getIntProperty(CONNECTOR_PROPBASE
          +  name + PORT_SUFFIX, 0);
      urlpath = config.getProperty(CONNECTOR_PROPBASE
          +  name + URLPATH_SUFFIX);

      if (urlpath == null)  {
    /*
     * If imq.jmx.rmiregistry.start or imq.jmx.rmiregistry.use is set
View Full Code Here

     *  imq.jmx.connector.<connector server name>.backlog
     *
     */
    private void initConnectorServer() throws BrokerException  {
  JMXConnectorServer  cs;
        BrokerConfig    config = Globals.getConfig();
  MBeanServer    mbs = agent.getMBeanServer();
  HashMap      env = new HashMap();
  boolean      useSSL, brokerHostTrusted;
  String      jmxHostname = Globals.getJMXHostname();
  int      backlog;

  if (connectorServer != null)  {
      return;
  }

  if (mbs == null)  {
      throw new BrokerException(rb.getString(rb.X_JMX_CANT_CREATE_CONNECTOR_SVR, name));
  }

        useSSL = config.getBooleanProperty(CONNECTOR_PROPBASE
          +  name
          + SSL_SUFFIX, false);

  /*
   * Query property that specifies if the broker is to be trusted.
   * If this property is not set, by default the broker is *not*
   * trusted.
   */
        brokerHostTrusted = config.getBooleanProperty(CONNECTOR_PROPBASE
          +  name
          + BROKER_HOST_TRUSTED_SUFFIX, false);

  backlog = config.getIntProperty(CONNECTOR_PROPBASE
          +  name
          + BACKLOG_SUFFIX, 0);

  try  {
      /*
 
View Full Code Here

        Properties props =  new Properties();

        String prefix = Globals.IMQ+"."+BridgeBaseContext.PROP_BRIDGE;

        BrokerConfig bc = Globals.getConfig();

        List keys = Globals.getConfig().getPropertyNames(prefix);

        String key = null;
        Iterator itr = keys.iterator();
        while (itr.hasNext()) {
            key = (String)itr.next();
            props.put(key, bc.getProperty(key));
        }

        props.put(prefix+".varhome",
                  Globals.getInstanceDir()+File.separator+
                  BridgeBaseContext.PROP_BRIDGE+"s");

        String lib = (String)bc.getProperty(Globals.JMQ_LIB_HOME_PROPERTY);

        props.put(prefix+".libhome", lib);

        props.put(prefix+".stomp.type", "stomp");
        props.put(prefix+".stomp.class",
View Full Code Here

    public static final String CMDUSER_PROPERTY = Globals.IMQ + ".imqcmd.user";
    public static final String CMDUSER_PWD_PROPERTY = Globals.IMQ + ".imqcmd.password";
    public static final String CMDUSER_SVC_PROPERTY = Globals.IMQ + ".imqcmd.service";

    public static boolean authenticateCMDUserIfset() {
        BrokerConfig bcfg = Globals.getConfig();
        String cmduser = bcfg.getProperty(CMDUSER_PROPERTY);
        if (cmduser == nullreturn true;

        Logger logger = Globals.getLogger();
        BrokerResources rb = Globals.getBrokerResources();
        if (cmduser.trim().length() == 0) {
            logger.log(Logger.FORCE, rb.X_BAD_PROPERTY_VALUE,
                                     CMDUSER_PROPERTY+ "=" + cmduser);
            return false;
        }
            /*
            if (!bcfg.getBooleanProperty(Globals.KEYSTORE_USE_PASSFILE_PROP)) {
                logger.log(Logger.FORCE, rb.E_AUTH_CMDUSER_PASSFILE_NOT_ENABLED,
                           Globals.KEYSTORE_USE_PASSFILE_PROP, cmduserProp);
                return false;
            }
            */
        String cmdpwd = bcfg.getProperty(CMDUSER_PWD_PROPERTY);
        if (cmdpwd == null) {
            logger.log(Logger.FORCE, rb.X_PASSWORD_NOT_PROVIDED,
                                     CMDUSER_PROPERTY+"="+cmduser);
            return false;
        }
        String cmdsvc = bcfg.getProperty(CMDUSER_SVC_PROPERTY);
        if (cmdsvc == null) cmdsvc = "admin";
        List activesvcs= ServiceManager.getAllActiveServiceNames();
        if (activesvcs == null || !activesvcs.contains(cmdsvc)) {
            logger.log(Logger.FORCE, rb.E_NOT_ACTIVE_SERVICE, cmdsvc,
                                     CMDUSER_PROPERTY+"="+cmduser);
View Full Code Here

    public static void shutdownMonitor() {
        if (task != null)
            task.cancel();
        active.clear();
  BrokerConfig cfg = Globals.getConfig();
  cfg.removeListener(METRICS_TIME_PROP, cl);
  cfg.removeListener(PERSIST_PROP, cl);
  cfg.removeListener(TTL_PROP, cl);
        cl = null;
    }
View Full Code Here

   * The static listener 'cl' updates the
   * static variables METRICS_TIME, PERSIST,
   * and TTL when their corresponding
   * properties are updated.
   */
  BrokerConfig cfg = Globals.getConfig();
  cfg.addListener(METRICS_TIME_PROP, cl);
  cfg.addListener(PERSIST_PROP, cl);
  cfg.addListener(TTL_PROP, cl);
  cfg.addListener(ENABLED_PROP, cl);
    }
View Full Code Here

   

    // create txn log writers
    String filename = null;
    try {
      BrokerConfig config = Globals.getConfig();
      SizeString filesize = config.getSizeProperty(TXNLOG_FILE_SIZE_PROP,
          DEFAULT_TXNLOG_FILE_SIZE);
         
      filename = MSG_LOG_FILENAME;

      String mode = "rwd";
View Full Code Here

        AccessController ac = new AccessController();
        ac.setServiceName(serviceName);
        ac.setServiceType(serviceType);

        String value = null;
        BrokerConfig config = Globals.getConfig();

        value = config.getProperty(PROP_ACCESSCONTROL_ENABLED);
        if (value != null && value.equals("false")) {
            ac.setAccessControlEnabled(false);
        }
        value = config.getProperty(PROP_SERVICE_PREFIX+serviceName+
                                   PROP_ACCESSCONTROL_ENABLED_SUFFIX);
        if (value != null && !value.trim().equals("")) {
            if (value.equals("false")) {
                ac.setAccessControlEnabled(false);
            }
            else {
                ac.setAccessControlEnabled(true);
            }
        }
        ac.getAuthProperties().setProperty(PROP_ACCESSCONTROL_ENABLED,
                     (ac.isAccessControlEnabled() ? "true":"false"));

        value = config.getProperty(PROP_SERVICE_PREFIX+serviceName+
                                   PROP_AUTHENTICATION_TYPE_SUFFIX);
        if (value == null || value.trim().equals("")) {
            value = config.getProperty(PROP_AUTHENTICATION_TYPE);
        }
        if (value != null && !value.trim().equals("")) {
            ac.setAuthType(value);
        }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.config.BrokerConfig

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.