Examples of AxisConfiguration


Examples of org.apache.axis2.engine.AxisConfiguration

 
  public static StorageManager getInMemoryStorageManager(ConfigurationContext context) throws SandeshaException {

    StorageManager inMemoryStorageManager = null;
   
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter parameter = config.getParameter(Sandesha2Constants.INMEMORY_STORAGE_MANAGER);
    if(parameter != null) inMemoryStorageManager = (StorageManager) parameter.getValue();
    if (inMemoryStorageManager != nullreturn inMemoryStorageManager;

    try {
      //Currently module policies (default) are used to find the storage manager. These cant be overriden
      //TODO change this so that different services can hv different storage managers.
      String storageManagerClassStr = getDefaultPropertyBean(context.getAxisConfiguration()).getInMemoryStorageManagerClass();
      inMemoryStorageManager = getStorageManagerInstance(storageManagerClassStr,context);
      parameter = new Parameter(Sandesha2Constants.INMEMORY_STORAGE_MANAGER, inMemoryStorageManager);
      config.addParameter(parameter);
    } catch(AxisFault e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.cannotInitInMemoryStorageManager,
          e.toString());
      throw new SandeshaException(message, e);
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

 
  public static StorageManager getPermanentStorageManager(ConfigurationContext context) throws SandeshaException {

    StorageManager permanentStorageManager = null;
   
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter parameter = config.getParameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER);
    if(parameter != null) permanentStorageManager = (StorageManager) parameter.getValue();
    if (permanentStorageManager != nullreturn permanentStorageManager;

    try {
      //Currently module policies (default) are used to find the storage manager. These cant be overriden
      //TODO change this so that different services can hv different storage managers.
      String storageManagerClassStr = getDefaultPropertyBean(context.getAxisConfiguration()).getPermanentStorageManagerClass();
      permanentStorageManager = getStorageManagerInstance(storageManagerClassStr,context);
      parameter = new Parameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER, permanentStorageManager);
      config.addParameter(parameter);
    } catch(AxisFault e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.cannotInitPersistentStorageManager,
          e.toString());
      throw new SandeshaException(message, e);
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

  private static StorageManager getStorageManagerInstance (String className,ConfigurationContext context) throws SandeshaException {
   
    StorageManager storageManager = null;
    try {
      ClassLoader classLoader = null;
      AxisConfiguration config = context.getAxisConfiguration();
      Parameter classLoaderParam = config.getParameter(Sandesha2Constants.MODULE_CLASS_LOADER);
      if(classLoaderParam != null) classLoader = (ClassLoader) classLoaderParam.getValue();

        if (classLoader==null)
          throw new SandeshaException (SandeshaMessageHelper.getMessage(
              SandeshaMessageKeys.classLoaderNotFound));
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

  public static MessageContext createNewRelatedMessageContext(RMMsgContext referenceRMMessage, AxisOperation operation)
      throws SandeshaException {
    try {
      MessageContext referenceMessage = referenceRMMessage.getMessageContext();
      ConfigurationContext configContext = referenceMessage.getConfigurationContext();
      AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();

      MessageContext newMessageContext = new MessageContext();
      newMessageContext.setConfigurationContext(configContext);
     
      Options newOptions = new Options ();
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

  }
 

  public static SecurityManager getSecurityManager(ConfigurationContext context) throws SandeshaException {
    SecurityManager util = null;
    AxisConfiguration config = context.getAxisConfiguration();
    Parameter p = config.getParameter(Sandesha2Constants.SECURITY_MANAGER);
    if(p != null) util = (SecurityManager) p.getValue();
    if (util != null) return util;

    try {
      //Currently module policies are used to find the security impl. These cant be overriden
      String securityManagerClassStr = getDefaultPropertyBean(context.getAxisConfiguration()).getSecurityManagerClass();
      util = getSecurityManagerInstance(securityManagerClassStr,context);
      p = new Parameter(Sandesha2Constants.SECURITY_MANAGER,util);
      config.addParameter(p);
    } catch(AxisFault e) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotInitSecurityManager, e.toString());
      throw new SandeshaException(message,e);
    }
    return util;
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

  }

  private static SecurityManager getSecurityManagerInstance (String className,ConfigurationContext context) throws SandeshaException {
    try {
      ClassLoader classLoader = null;
      AxisConfiguration config = context.getAxisConfiguration();
      Parameter classLoaderParam = config.getParameter(Sandesha2Constants.MODULE_CLASS_LOADER);
      if(classLoaderParam != null) classLoader = (ClassLoader) classLoaderParam.getValue();

      if (classLoader==null)
        throw new SandeshaException (SandeshaMessageHelper.getMessage(SandeshaMessageKeys.classLoaderNotFound));
       
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

  // initialize the module
  public void init(ConfigurationContext configContext,
      AxisModule module) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Entry: SandeshaModule::init, " + configContext);

    AxisConfiguration config = configContext.getAxisConfiguration();

    //storing the Sandesha module as a parameter.
    Parameter parameter = new Parameter(Sandesha2Constants.MODULE_CLASS_LOADER,module.getModuleClassLoader());
    config.addParameter(parameter);

    //init the i18n messages
    SandeshaMessageHelper.innit();
   
    //storing the module as a static variable
    SandeshaUtil.setAxisModule(module);
   
    // continueUncompletedSequences (storageManager,configCtx);

    SandeshaPolicyBean constantPropertyBean = PropertyManager.loadPropertiesFromDefaultValues();
    SandeshaPolicyBean propertyBean = PropertyManager.loadPropertiesFromModuleDescPolicy(module,constantPropertyBean);
   
    if (propertyBean==null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.couldNotLoadModulePolicies);
      log.error (message);
     
      propertyBean = PropertyManager.loadPropertiesFromDefaultValues();
    } else {
      if (log.isDebugEnabled()) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.modulePoliciesLoaded);
        log.info (message);
      }
    }
   
    parameter = new Parameter (Sandesha2Constants.SANDESHA_PROPERTY_BEAN, propertyBean);
    config.addParameter(parameter);
   
    // Reset both storage managers
    parameter = config.getParameter(Sandesha2Constants.INMEMORY_STORAGE_MANAGER);
    if(parameter != null) config.removeParameter(parameter);
    parameter = config.getParameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER);
    if(parameter != null) config.removeParameter(parameter);

    try {
      StorageManager inMemorytorageManager = SandeshaUtil.getInMemoryStorageManager(configContext);
      inMemorytorageManager.initStorage(module);
    } catch (SandeshaStorageException e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.cannotInitInMemoryStorageManager,
          e.toString());
      log.debug(message,e);
    }
   
    try {
      StorageManager permanentStorageManager = SandeshaUtil.getPermanentStorageManager(configContext);
      permanentStorageManager.initStorage(module);
    } catch (SandeshaStorageException e) {
      String message = SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.cannotInitPersistentStorageManager,
          e.toString());
      log.debug(message,e);
    }
   
    // Reset the security manager, and then load it
    parameter = config.getParameter(Sandesha2Constants.SECURITY_MANAGER);
    if(parameter != null) config.removeParameter(parameter);
    SecurityManager util = SandeshaUtil.getSecurityManager(configContext);
    util.initSecurity(module);

    // Mark the config context so that we can run sync 2-way interations over
    // RM, but at the same time switch it off for unreliable messages.
    configContext.setProperty(Constants.Configuration.USE_ASYNC_OPERATIONS, Boolean.TRUE);
    configContext.getAxisConfiguration().addTargetResolver(
        new TargetResolver() {
          public void resolveTarget(MessageContext messageContext) {
           
            //if Sandesha2 is not engaged we can set the property straight away
           
            boolean engaged = false;
           
            //checking weather the module is engaged at the System level
            AxisConfiguration axisConfiguration = messageContext.getConfigurationContext().getAxisConfiguration();
            if (axisConfiguration!=null) {
              Collection modules = axisConfiguration.getEngagedModules();
              for (Iterator iter = modules.iterator();iter.hasNext();) {
                String moduleName = (String) iter.next();
                if (moduleName!=null && moduleName.startsWith (Sandesha2Constants.MODULE_NAME)) {
                  engaged = true;
                }
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

    public RMDBeanMgrTest(String name) {
        super(name);
    }

    public void setUp() throws Exception {
        AxisConfiguration axisConfig = new AxisConfiguration();
        SandeshaPolicyBean propertyBean = PropertyManager.loadPropertiesFromDefaultValues();
        Parameter parameter = new Parameter ();
        parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        parameter.setValue(propertyBean);
        axisConfig.addParameter(parameter);
       
        ConfigurationContext configCtx = new ConfigurationContext(axisConfig);
       
        ClassLoader classLoader = getClass().getClassLoader();
        parameter = new Parameter(Sandesha2Constants.MODULE_CLASS_LOADER,classLoader);
        axisConfig.addParameter(parameter);
       
        StorageManager storageManager = SandeshaUtil.getInMemoryStorageManager(configCtx);
        transaction = storageManager.getTransaction();
        mgr = storageManager.getRMDBeanMgr();
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

     * @param key The property to retrieve from the AxisConfiguration
     * @return the value associated with the property or null if the property did not exist on the configuration.
     */
    private String getProperty(String key) {
        String propertyValue = null;
        AxisConfiguration axisConfig = serviceDelegate.getServiceDescription().getAxisConfigContext().getAxisConfiguration();
        Parameter parameter = axisConfig.getParameter(key);
        if (parameter != null) {
            propertyValue = (String) parameter.getValue();
        }
        return propertyValue;
    }
View Full Code Here

Examples of org.apache.axis2.engine.AxisConfiguration

        String flagValue = null;
        org.apache.axis2.context.MessageContext axis2MC = msgContext.getAxisMessageContext();
        if (axis2MC != null && axis2MC.getConfigurationContext() != null
                && axis2MC.getConfigurationContext().getAxisConfiguration() != null ) {
            AxisConfiguration axisConfig = axis2MC.getConfigurationContext().getAxisConfiguration();
            Parameter parameter = axisConfig.getParameter(org.apache.axis2.jaxws.Constants.DISABLE_SOAPFAULT_FOR_LOCAL_EXCEPTION);
            if (parameter != null) {
                flagValue = (String) parameter.getValue();
                if (log.isDebugEnabled()) {
                    log.debug("Property set on configuration: " + org.apache.axis2.jaxws.Constants.DISABLE_SOAPFAULT_FOR_LOCAL_EXCEPTION
                            + " with value " + flagValue);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.