Esempio n. 1
0
 protected void initService() throws Exception {
   Element e = getPersist();
   QFactory factory = getServer().getFactory();
   sm = (SMAdapter) factory.newInstance(getImpl());
   factory.setLogger(sm, e);
   factory.setConfiguration(sm, e);
 }
Esempio n. 2
0
  private KeepAliveHandler newKeepAliveHandler() throws ConfigurationException {
    QFactory f = getFactory();
    Element e = getPersist().getChild("keep-alive-handler");
    if (e != null) {
      String handlerName = e.getAttributeValue("class");

      KeepAliveHandler handler = (KeepAliveHandler) f.newInstance(handlerName);
      f.setConfiguration(handler, e);
      return handler;
    }
    return null;
  }
Esempio n. 3
0
  private ProtocolHandler newProtocolHandler() throws ConfigurationException {
    QFactory f = getFactory();
    Element e = getPersist().getChild("protocol-handler");
    if (e == null) {
      throw new ConfigurationException("protocol-handler element is required.");
    }

    String handlerName = e.getAttributeValue("class");
    String packagerName = e.getAttributeValue("packager");

    ProtocolHandler handler = (ProtocolHandler) f.newInstance(handlerName);
    f.setLogger(handler, e);
    f.setConfiguration(handler, e);

    ISOPackager packager = (ISOPackager) f.newInstance(packagerName);
    handler.setPackager(packager);
    f.setConfiguration(packager, e);

    QFactory.invoke(handler, "setHeader", e.getAttributeValue("header"));
    return handler;
  }
Esempio n. 4
0
 private void addListeners() throws ConfigurationException {
   QFactory factory = getFactory();
   Iterator iter = getPersist().getChildren("request-listener").iterator();
   while (iter.hasNext()) {
     Element l = (Element) iter.next();
     ISORequestListener listener =
         (ISORequestListener) factory.newInstance(l.getAttributeValue("class"));
     factory.setLogger(listener, l);
     factory.setConfiguration(listener, l);
     server.addISORequestListener(listener);
   }
 }
Esempio n. 5
0
 @SuppressWarnings({"WhileLoopReplaceableByForEach"})
 private void addListeners() throws ConfigurationException {
   requestListeners = new ArrayList<ISORequestListener>();
   QFactory factory = getFactory();
   Iterator iter = getPersist().getChildren("request-listener").iterator();
   while (iter.hasNext()) {
     Element l = (Element) iter.next();
     ISORequestListener listener =
         (ISORequestListener) factory.newInstance(l.getAttributeValue("class"));
     factory.setLogger(listener, l);
     factory.setConfiguration(listener, l);
     requestListeners.add(listener);
   }
 }
Esempio n. 6
0
  private void addServerSocketFactory() throws ConfigurationException {
    QFactory factory = getFactory();
    Element persist = getPersist();

    Element serverSocketFactoryElement = persist.getChild("server-socket-factory");

    if (serverSocketFactoryElement != null) {
      ISOServerSocketFactory serverSocketFactory =
          (ISOServerSocketFactory)
              factory.newInstance(serverSocketFactoryElement.getAttributeValue("class"));
      factory.setLogger(serverSocketFactory, serverSocketFactoryElement);
      factory.setConfiguration(serverSocketFactory, serverSocketFactoryElement);
      server.setSocketFactory(serverSocketFactory);
    }
  }