Package org.apache.axis2.description

Examples of org.apache.axis2.description.Parameter


  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());
View Full Code Here


  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());
View Full Code Here

   
    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

    if (axisModule==null) {
      String message = SandeshaMessageKeys.moduleNotSet;
      throw new SandeshaException (message);
    }
   
    Parameter propertiesFromRefMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceMessage);
    if (propertiesFromRefMsg!=null) {
      String value = (String) propertiesFromRefMsg.getValue();
      if (value!=null) {
        value = value.trim();
        String[] propertyNames = value.split(",");
        for (int i=0;i<propertyNames.length;i++) {
          String tmp = propertyNames[i];
          String propertyName = null;
          String targetPropertyName = null;
          if (tmp.indexOf (":")>=0) {
            //if the property name is given as two values seperated by a colon, this gives the key of the from msg
            //and the key for the To Msg respsctively.
            String[] vals = tmp.split(":");
            propertyName = vals[0].trim();
            targetPropertyName = vals[1].trim();
          } else {
            propertyName = targetPropertyName = tmp;
          }
         
          Object val = fromMessage.getProperty(propertyName);
          if (val!=null) {
            toMessage.setProperty(targetPropertyName,val);
          }
        }
      }
    }
   
    Parameter propertiesFromRefReqMsg = axisModule.getParameter(Sandesha2Constants.propertiesToCopyFromReferenceRequestMessage);
    OperationContext referenceOpCtx = fromMessage.getOperationContext();
    MessageContext referenceRequestMessage = null;
    if (referenceOpCtx!=null)
      referenceRequestMessage=referenceOpCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
   
    if (propertiesFromRefReqMsg!=null && referenceRequestMessage!=null) {
      String value = (String) propertiesFromRefReqMsg.getValue();
      if (value!=null) {
        value = value.trim();
        String[] propertyNames = value.split(",");
        for (int i=0;i<propertyNames.length;i++) {
          String propertyName = propertyNames[i];
View Full Code Here

   
  }
 
  public static SandeshaPolicyBean getDefaultPropertyBean (AxisConfiguration axisConfiguration) throws SandeshaException {
    Parameter parameter = axisConfiguration.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
    if (parameter==null)
      throw new SandeshaException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.defaultPropertyBeanNotSet));
   
    SandeshaPolicyBean sandeshaPropertyBean = (SandeshaPolicyBean) parameter.getValue();
    return sandeshaPropertyBean;
  }
View Full Code Here

    return allComplete;
 
  }
 
  public static SandeshaPolicyBean getPropertyBean (AxisDescription axisDescription) throws SandeshaException {
    Parameter parameter = axisDescription.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
    if (parameter==null)
      throw new SandeshaException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.propertyBeanNotSet));
   
    SandeshaPolicyBean propertyBean = (SandeshaPolicyBean) parameter.getValue();
    if (propertyBean==null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.policyBeanNotFound);
      throw new SandeshaException (message);
    }
View Full Code Here

  }

  public static SandeshaPolicyBean loadPropertiesFromModuleDesc(AxisModule desc) throws SandeshaException {
    SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();

    Parameter expoBackoffParam = desc.getParameter(Sandesha2Constants.Properties.ExponentialBackoff);
    String expoBackoffStr = (String) expoBackoffParam.getValue();
    loadExponentialBackoff(expoBackoffStr, propertyBean);

    Parameter retransmissionIntParam = desc.getParameter(Sandesha2Constants.Properties.RetransmissionInterval);
    String retransmissionIntStr = (String) retransmissionIntParam.getValue();
    loadRetransmissionInterval(retransmissionIntStr, propertyBean);

    Parameter acknowledgementIntParam = desc.getParameter(Sandesha2Constants.Properties.AcknowledgementInterval);
    String acknowledgementIntStr = (String) acknowledgementIntParam.getValue();
    loadAcknowledgementInterval(acknowledgementIntStr, propertyBean);

    Parameter inactivityTimeoutParam = desc.getParameter(Sandesha2Constants.Properties.InactivityTimeout);
    String inactivityTimeoutStr = (String) inactivityTimeoutParam.getValue();
    Parameter inactivityTimeoutMeasureParam = desc
        .getParameter(Sandesha2Constants.Properties.InactivityTimeoutMeasure);
    String inactivityTimeoutMeasure = (String) inactivityTimeoutMeasureParam.getValue();
    loadInactivityTimeout(inactivityTimeoutStr, inactivityTimeoutMeasure, propertyBean);

    Parameter sequenceRemovalTimeoutParam = desc.getParameter(Sandesha2Constants.Properties.SequenceRemovalTimeout);
    String sequenceRemovalTimeoutStr = (String) sequenceRemovalTimeoutParam.getValue();
    Parameter sequenceRemovalTimeoutMeasureParam = desc
        .getParameter(Sandesha2Constants.Properties.SequenceRemovalTimeoutMeasure);
    String sequenceRemovalTimeoutMeasure = (String) sequenceRemovalTimeoutMeasureParam.getValue();
    loadSequenceRemovalTimeout(sequenceRemovalTimeoutStr, sequenceRemovalTimeoutMeasure, propertyBean);

    // Parameter storageMgrClassParam =
    // desc.getParameter(Sandesha2Constants.Properties.StorageManager);
    // String storageMgrClassStr = (String) storageMgrClassParam.getValue();
    // loadStoragemanagerClass(storageMgrClassStr,propertyBean);

    Parameter inMemoryStorageMgrClassParam = desc
        .getParameter(Sandesha2Constants.Properties.InMemoryStorageManager);
    String inMemoryStorageMgrClassStr = (String) inMemoryStorageMgrClassParam.getValue();
    loadInMemoryStoragemanagerClass(inMemoryStorageMgrClassStr, propertyBean);

    Parameter permanentStorageMgrClassParam = desc
        .getParameter(Sandesha2Constants.Properties.PermanentStorageManager);
    String permanentStorageMgrClassStr = (String) permanentStorageMgrClassParam.getValue();
    loadPermanentStoragemanagerClass(permanentStorageMgrClassStr, propertyBean);

    Parameter inOrderInvocationParam = desc.getParameter(Sandesha2Constants.Properties.InOrderInvocation);
    String inOrderInvocation = (String) inOrderInvocationParam.getValue();
    loadInOrderInvocation(inOrderInvocation, propertyBean);
   
    Parameter enableMakeConnectionParam = desc.getParameter(Sandesha2Constants.Properties.EnableMakeConnection);
    String enableMakeConnection = (String) enableMakeConnectionParam.getValue();
    loadEnableMakeConnection(enableMakeConnection, propertyBean);

    Parameter useSerializationParam = desc.getParameter(Sandesha2Constants.Properties.UseMessageSerialization);
    String useSerialization = (String) useSerializationParam.getValue();
    loadUseSerialization(useSerialization, propertyBean);

    Parameter messageTypesToDropParam = desc.getParameter(Sandesha2Constants.Properties.MessageTypesToDrop);
    String messageTypesToDrop = (String) messageTypesToDropParam.getValue();
    loadMessageTypesToDrop(messageTypesToDrop, propertyBean);

    Parameter securityManagerClassParam = desc.getParameter(Sandesha2Constants.Properties.SecurityManager);
    String securityManagerClassStr = (String) securityManagerClassParam.getValue();
    loadSecurityManagerClass(securityManagerClassStr,propertyBean);

    return propertyBean;
  }
View Full Code Here

 
  public static void setPolicyBean (ServiceClient serviceClient, SandeshaPolicyBean policyBean) throws SandeshaException {
    try {
      AxisService axisService = serviceClient.getAxisService();
      if (axisService!=null) {
        Parameter parameter = axisService.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        SandeshaPolicyBean parent = null;
        if (parameter==null) {
          parameter = new Parameter ();
          parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        } else {
          parent = (SandeshaPolicyBean) parameter.getValue();
          policyBean.setParent(parent);
        }
       
        parameter.setValue(policyBean);
        axisService.addParameter(parameter);
      } else {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSetPolicyBeanServiceNull);
        throw new SandeshaException (message);
      }
View Full Code Here

    }
   
    // look at the service to see if RM is totally disabled. This allows the user to disable RM using
    // a property on the service, even when Sandesha is engaged.
    if (msgCtx.getAxisService() != null) {
      Parameter unreliableParam = msgCtx.getAxisService().getParameter(SandeshaClientConstants.UNRELIABLE_MESSAGE);
      if (null != unreliableParam && "true".equals(unreliableParam.getValue())) {
        log.debug("Exit: SandeshaInHandler::invoke, Service has disabled RM " + returnValue);
        return returnValue;
      }
    }
    if (log.isDebugEnabled()) log.debug("SandeshaInHandler::invoke Continuing beyond basic checks");
View Full Code Here

 

  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);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.description.Parameter

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.