示例#1
0
  public void setConfiguration(Configuration cfg) throws ConfigurationException {
    super.setConfiguration(cfg);

    Element persist = getPersist();

    String ssp = persist.getChildText("space");

    sp = SpaceFactory.getSpace(ssp != null ? ssp : "");

    String sTimeout = persist.getChildText("timeout");
    timeout = sTimeout == null ? 10000 : Long.parseLong(sTimeout);

    contextName = persist.getChildText("context-name");
    if (contextName == null) {
      throw new ConfigurationException(
          "Missing 'context-name' property - the context name of the object received on 'in'");
    }

    in = persist.getChildText("in");
    if (in == null) {
      throw new ConfigurationException(
          "Missing 'in' property - the queue to process objects from.");
    }

    out = persist.getChildText("out");
    if (out == null) {
      throw new ConfigurationException(
          "Missing 'out' property - the target queue of the created context");
    }

    Element values = persist.getChild("context-values");
    if (values != null) {
      contextValues = values.getChildren();
    }
  }
 @Override
 protected void initService() throws Exception {
   super.initService();
   log.info("MySql Connection Pool is initializing.....");
   pool = initMySqlConnectionPool();
   NameRegistrar.register("connection.pool.MySqlConnectionPool", this);
   log.info("MySql Connection Pool initialed.");
 }
 @Override
 protected void stopService() throws Exception {
   super.stopService();
   log.info("MySql Connection Pool is closing....");
   if (pool != null) {
     pool.close();
   }
   log.info("MySql Connection Pool was closed successfully.");
 }
 @Override
 protected void startService() throws Exception {
   super.startService();
   if (pool != null) log.info("MySql Connection Pool is ready to serve. ");
 }
示例#5
0
 public void stop() {
   super.stop();
   NameRegistrar.unregister("QBeanFactory." + getName());
 }
示例#6
0
 public void start() {
   super.start();
   NameRegistrar.register("QBeanFactory." + getName(), this);
 }