Package net.sf.xbus.base.core.config

Examples of net.sf.xbus.base.core.config.Configuration


    Message sendMessage = null;

    while ((destString != null) && (!rollback))
    {
      sendMessage = null;
      Configuration config = Configuration.getInstance();
      destination = new XBUSSystem(destString, message.getSource()
          .getAddresses(), config.getValueAsBooleanOptional("System",
          destString, "Broadcast"));
      // The last parameter instructs the sender to try a broadcast for
      // all configured addtional addresses. This will only be active if
      // the destination address really contains a reference to the
      // addtional address information.
View Full Code Here


    return result;
  }

  private String getRouterEntry(Message message, String key) throws XException
  {
    Configuration config = Configuration.getInstance();
    String retString = config.getValueOptional(CHAPTER, message.getSource().getName(), key);
    if (retString == null)
    {
      retString = config.getValue(CHAPTER, getSection(message), key);
    }
   
    return retString;
  }
View Full Code Here

   * @param destination name of the interface definition
   * @throws XException if something goes wrong
   */
  public static Sender createSender(XBUSSystem destination) throws XException
  {
    Configuration config = Configuration.getInstance();
    String senderClassShortname = config.getValue(Constants.CHAPTER_SYSTEM,
        destination.getName(), "Sender");
    String senderClass = Configuration.getClass("Sender",
        senderClassShortname);

    Class[] conArgsClass = new Class[]
View Full Code Here

    return retString;
  }
 
  private String getRouterEntryOptional(Message message ,String key) throws XException
  {
    Configuration config = Configuration.getInstance();
    String retString = config.getValueOptional(CHAPTER, message.getSource().getName(), key);
    if (retString == null)
    {
      retString = config.getValueOptional(CHAPTER, getSection(message), key);
    }
   
    return retString;
  }
View Full Code Here

   * @param source the name of the system, from which the message was received
   */
  public static Message createApplicationMessage(XBUSSystem source)
      throws XException
  {
    Configuration config = Configuration.getInstance();

    String messageClassShortname = config.getValue(
        Constants.CHAPTER_SYSTEM, source.getName(), "Message");

    String messageClass = Configuration.getClass("Message",
        messageClassShortname);

View Full Code Here

   */
  static public void process(String system) throws XException
  {
    String preProcessor = null;
    Vector preProcessors = null;
    Configuration config = Configuration.getInstance();
    if (RECEIVER_SERVICE.equals(system))
    {
      preProcessor = config.getValueOptional("Base", "ReceiverService",
          "PreProcessor");
      if (preProcessor != null)
      {
        preProcessors = new Vector();
        preProcessors.add(preProcessor);
      } // then (preProcessor != null): a single pre-processor
      else
      {
        preProcessor = config.getValueOptional("Base",
            "ReceiverService", "PreProcessor1");
        if (preProcessor != null)
        {
          preProcessors = new Vector();
          for (int i = 2; preProcessor != null; i++)
          {
            preProcessors.add(preProcessor);
            preProcessor = config.getValueOptional("Base",
                "ReceiverService", "PreProcessor" + i);
          } // for (int i=1; preProcessor!=null; i++)
        } // if (preProcessor != null): some multiple pre-processors
      } // else (preProcessor != null): no single pre-processors
    } // then (RECEIVER_SERVICE.equals(system))
    else
    {
      preProcessor = config.getValueOptional(Constants.CHAPTER_SYSTEM,
          system, "PreProcessor");
      if (preProcessor != null)
      {
        preProcessors = new Vector();
        preProcessors.add(preProcessor);
      } // then (preProcessor != null): a single pre-processor
      else
      {
        preProcessor = config.getValueOptional(
            Constants.CHAPTER_SYSTEM, system, "PreProcessor1");
        if (preProcessor != null)
        {
          preProcessors = new Vector();
          for (int i = 2; preProcessor != null; i++)
          {
            preProcessors.add(preProcessor);
            preProcessor = config.getValueOptional(
                Constants.CHAPTER_SYSTEM, system,
                "PreProcessor" + i);
          } // for (int i=1; preProcessor!=null; i++)
        } // if (preProcessor != null): some multiple pre-processors
      } // else (preProcessor != null): no single pre-processors
View Full Code Here

        .getName()));

    /*
     * Getting an instance of the LDAPConnection
     */
    Configuration config = Configuration.getInstance();
    String connectionName = config.getValue(Constants.CHAPTER_SYSTEM,
        mDestination.getName(), "LDAPConnection");
    LDAPConnection connection = LDAPConnection.getInstance(connectionName);

    /*
     * Execute the given LDAP requests
View Full Code Here

    {source.getFunction(), source.getSource(), source.getId()};

    /*
     * Getting the type of Message that must be created
     */
    Configuration config = Configuration.getInstance();
    String newMessageShortname = config.getValue(Constants.CHAPTER_SYSTEM,
        destination.getName(), "Message");
    String newMessageName = Configuration.getClass("Message",
        newMessageShortname);

    /*
 
View Full Code Here

    /*
     * 1. Getting the short name of the class
     */
    String chapter = "Application";
    Configuration config = Configuration.getInstance();
    String callClassShortname = config.getValueOptional(chapter, call.getSource().getName(),
    "Class");
    if (callClassShortname == null)
    {
    callClassShortname = config.getValueOptional(chapter, section,
        "Class");
    }
   
    /*
     * 2. Creating the class and calling the method
     */
    if (callClassShortname == null)
    {
      /*
       * If there is no entry in the configuration, the Router is used by
       * default
       */
      Router router = new Router();
      router.route(call);
    } // then (callClassShortname == null)
    else
    {
      /*
       * 2.a Getting the complete class name and creating the class
       */
      String callClass = Configuration.getClass("Application",
          callClassShortname);

      Object applObject = ReflectionSupport.createObject(callClass);

      /*
       * 2.c Getting the method and invoking it
       */
      Class[] parameterTypes = new Class[]
      {Message.class};
      Object[] arguments = new Object[]
      {call};

      String applMethod = config.getValueOptional(chapter, call.getSource().getName(), "Method");
      if (applMethod == null)
      {
        applMethod = config.getValue(chapter, section, "Method");
      }

      ReflectionSupport.callMethod(applMethod, applObject,
          parameterTypes, arguments);
    } // else (callClassShortname == null)
View Full Code Here

  }

  protected PostMethod initialize(String function, String url)
      throws XException
  {
    Configuration config = Configuration.getInstance();

    /*
     * HTTPParameterSender doesn`t have a Content-Type, all other
     * HTTPxxxSenders must have that parameter
     */
    if (!(this instanceof HTTPParameterSender))
    {
      mContentType = config.getValue(Constants.CHAPTER_SYSTEM,
          mDestination.getName(), "Content-Type");
    }

    /*
     * If no URL is given, we must have it in the configuration
     */
    if (url == null)
    {
      url = config.getValue(Constants.CHAPTER_SYSTEM, mDestination
          .getName(), "URL");
    }
    url = mDestination.replaceAllMarkers(url)[0];

    setKeystore(url);

    /*
     * Self-signed certificates SHOULD NOT be used for productive systems
     * due to security reasons, unless it is a concious decision and you are
     * perfectly aware of security implications of accepting self-signed
     * certificates.
     */
    boolean allowSelfSignedCertificate = config.getValueAsBooleanOptional(
        Constants.CHAPTER_SYSTEM, mDestination.getName(),
        "AllowSelfSignedCertificate");
    if (allowSelfSignedCertificate)
    {
      Protocol.registerProtocol("https", new Protocol("https",
View Full Code Here

TOP

Related Classes of net.sf.xbus.base.core.config.Configuration

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.