Package lt.baltic_amadeus.jqbridge.server

Examples of lt.baltic_amadeus.jqbridge.server.Config


    private long scanInterval;

    public FilePort(FileProvider provider, String name) {
        this.provider = provider;
        this.name = name;
        Config conf = provider.getConfig();
        /* global port options */
        String pfx = "port." + name + ".";
        scanInterval = conf.getInt(pfx + "scanInterval", 5000);
        /* define queues */
        queues = new HashMap();
        for (NamesIterator i = (NamesIterator) conf.namesIterator("port[.]" + name + "[.]q[.]([^.]+)[.]dir"); i.hasNext(); ) {
            String prop = (String) i.next();
            defineQueue(conf, i.group(1), conf.getString(prop));
        }
    }
View Full Code Here


    private File stopFile;
    private int condition;
   
    public StopFileSource(CommandProcessor cmdProc) {
        this.cmdProc = cmdProc;
        Config conf = cmdProc.getConfig();
        String pfx = "StopFileSource.";
        String stopFileProperty = pfx + "stopFile";
        String stopFileName = conf.getString(stopFileProperty);
        if (stopFileName == null || stopFileName.equals(""))
            stopFileName = "jqbridge.stop";
        String conditionName = conf.getString(pfx + "condition");
        if (conditionName == null || conditionName.equals("") || conditionName.equalsIgnoreCase("remove")) {
            condition = CD_REMOVE;
        }
        else if (conditionName.equalsIgnoreCase("create")) {
            condition = CD_CREATE;
View Full Code Here

   * parts of the application.
   * @param args command line arguments
   */
  public static void main(String[] args) throws Exception {
    // TODO Actually parse command line
    Config cfg = new Config();
    String cfgName = "etc/jqbridge.properties";
    if (args.length > 0)
        cfgName = args[0];
    cfg.loadProperties(new File(cfgName));
    Server srv = new Server(cfg);
    srv.run();
    System.exit(0);
  }
View Full Code Here

     * will trigger client tcp/ip connection. This is controlled
     * by <code>TRANSPORT_PROPERTY</code>. We don't touch those and only
     * set options related to bindings mode of operation.
     */
    public void start() throws BridgeException {
        Config conf = provider.getConfig();
        String pfx = "port." + name + ".";
        /* Queue manager name */
        queueMgr = conf.getString(pfx + "queuemgr");
        if (queueMgr == null || queueMgr.equals(""))
            throw new PortConfigurationException(this, "queue manager property (queuemgr) not set");
        /* Connection mode */
        connProps = new Hashtable();
        String connMode = conf.getString(pfx + "connmode", "bindings");
        if (connMode.equals("bindings"))
            connProps.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);
        else if (connMode.equals("client"))
            connProps.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
        else
            throw new PortConfigurationException(this, "connection mode property (connmode) must be either 'bindings' or 'client'");
        /* Connection properties */
        String hostStr = conf.getString(pfx + "host");
        String portStr = conf.getString(pfx + "port");
        String chanStr = conf.getString(pfx + "channel");
        String userStr = conf.getString(pfx + "user");
        String passStr = conf.getString(pfx + "password");
        if (connMode.equals("bindings")) {
            if (hostStr != null && ! hostStr.equals("") ||
                portStr != null & ! portStr.equals("") ||
                chanStr != null & ! chanStr.equals("") ||
                userStr != null & ! userStr.equals("") ||
View Full Code Here

     * will trigger client tcp/ip connection. This is controlled
     * by <code>TRANSPORT_PROPERTY</code>. We don't touch those and only
     * set options related to bindings mode of operation.
     */
    public void start() throws BridgeException {
        Config conf = provider.getConfig();
        String pfx = "port." + name + "."
        /* Queue manager name */
        queueMgr = conf.getString(pfx + "queuemgr");
        if (queueMgr == null || queueMgr.equals(""))
            throw new PortConfigurationException(this, "queue manager property (queuemgr) not set");
        /* Connection properties */
        connProps = new Hashtable();
        connProps.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS);
View Full Code Here

      return env.getMessageLogger();
  }
 
  public void init(ProviderEnv env) throws BridgeException {
      this.env = env;
      Config conf = env.getConfig();
      String name = env.getName();
    String pfx = "provider." + name + ".";
    try {
      String factoryClassName = conf.getString(pfx + "factory");
      factoryClass = Class.forName(factoryClassName);
      // try to instantiate and cast the factory as an additional check
      QueueConnectionFactory factory = (QueueConnectionFactory) factoryClass.newInstance();
      // fake check to make factory var used
      if (factory == null)
View Full Code Here

                // silence
            }
        }
        /* setup factory */
        QueueConnectionFactory factory = provider.createConnectionFactory(name);
        Config conf = provider.getConfig();
        String pfx = "port." + name + ".";
        String user = conf.getString(pfx + "user");
        String password = conf.getString(pfx + "password", "");
        assignProperties(conf, "port[.]" + name + "[.]set[.][^.]+", factory);
        /* create & start connection */
        try {
            if (user != null && !user.equals(""))
                connection = factory.createQueueConnection(user, password);
View Full Code Here

      return env.getMessageLogger();
  }
 
  public void init(ProviderEnv env) throws BridgeException {
      this.env = env;
      Config conf = env.getConfig();
      String name = env.getName();
    String pfx = "provider." + name + ".";
    try {
      String factoryClassName = conf.getString(pfx + "factory");
      factoryClass = Class.forName(factoryClassName);
      // try to instantiate and cast the factory as an additional check
      QueueConnectionFactory factory = (QueueConnectionFactory) factoryClass.newInstance();
      // fake check to make factory var used
      if (factory == null)
View Full Code Here

TOP

Related Classes of lt.baltic_amadeus.jqbridge.server.Config

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.