Package org.apache.sandesha2.policy

Examples of org.apache.sandesha2.policy.SandeshaPolicyBean


    Iterator operations = service.getOperations();
   
    while (operations.hasNext())
    {
      AxisOperation op = (AxisOperation) operations.next();
      SandeshaPolicyBean propertyBean =
        SandeshaUtil.getPropertyBean(op);

      // Indicate that the sequence should timeout after 2 second
      // And that it should be deleted after 2 seconds
      if (propertyBean != null) {
        propertyBean.setInactiveTimeoutInterval(2, "seconds");
        propertyBean.setSequenceRemovalTimeoutInterval(2, "seconds");
      }
    }
   
    // Send a single ping message
    serviceClient.fireAndForget(getPingOMBlock("ping1"));
View Full Code Here


public class RMAssertionBuilder implements AssertionBuilder {

    public Assertion build(OMElement element, AssertionBuilderFactory factory)
            throws IllegalArgumentException {

        SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();
        Policy policy = PolicyEngine.getPolicy(element.getFirstElement());

        processElements(policy.getPolicyComponents(), propertyBean);
        return propertyBean;
    }
View Full Code Here

 
  public void setUp () throws Exception {
    super.setUp();
   
    // Override the config to disable make connection
    SandeshaPolicyBean config = SandeshaUtil.getDefaultPropertyBean(configContext.getAxisConfiguration());
    config.setEnableMakeConnection(false);
  }
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();
View Full Code Here

          specVersion = SequenceManager.getSpecVersion(msgContext, storageManager);
        } else {
          specVersion = rmsBean.getRMVersion();
        }
        if(specVersion == Sandesha2Constants.SPEC_VERSIONS.v1_1) {
          SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configContext.getAxisConfiguration());
          if(!policy.isEnableMakeConnection()) {
            String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionDisabled);
            throw new SandeshaException(message);
          }
        }
      }
View Full Code Here

     
      try {
        AxisEngine engine = new AxisEngine (msgCtx.getConfigurationContext());
        InvocationResponse response = InvocationResponse.CONTINUE;
       
        SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(msgCtx.getAxisOperation());
        if(policy.isUseMessageSerialization()) {
          if(msgCtx.isPaused()) {
            if (log.isDebugEnabled())
              log.debug("Resuming a send for message : " + msgCtx.getEnvelope().getHeader());
            msgCtx.setPaused(false);
            msgCtx.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.FALSE);
View Full Code Here

      Object responseWritten = msgCtx.getOperationContext().getProperty(Constants.RESPONSE_WRITTEN);
      if (responseWritten==null || !Constants.VALUE_TRUE.equals(responseWritten)) {       
        sendAck = true;
      }
    } else if (!acksTo.hasAnonymousAddress()) {
      SandeshaPolicyBean policyBean = SandeshaUtil.getPropertyBean (msgCtx.getAxisOperation());
      long ackInterval = policyBean.getAcknowledgementInterval();
      long timeToSend = System.currentTimeMillis() + ackInterval;
     
      RMMsgContext ackRMMsgContext = AcknowledgementManager.generateAckMessage(rmMsgCtx, bean, sequenceId, storageManager,true);

      AcknowledgementManager.addAckBeanEntry(ackRMMsgContext, sequenceId, timeToSend, storageManager);
View Full Code Here

*/

public class PropertyManager {

  public static SandeshaPolicyBean loadPropertiesFromDefaultValues() throws SandeshaException {
    SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();
    propertyBean.setAcknowledgementInterval(Sandesha2Constants.Properties.DefaultValues.AcknowledgementInterval);
    propertyBean.setExponentialBackoff(Sandesha2Constants.Properties.DefaultValues.ExponentialBackoff);
    propertyBean.setInactiveTimeoutInterval(Sandesha2Constants.Properties.DefaultValues.InactivityTimeout,
        Sandesha2Constants.Properties.DefaultValues.InactivityTimeoutMeasure);

    propertyBean.setSequenceRemovalTimeoutInterval(Sandesha2Constants.Properties.DefaultValues.sequenceRemovalTimeout,
        Sandesha2Constants.Properties.DefaultValues.sequenceRemovalTimeoutMeasure);
   
    propertyBean.setInOrder(Sandesha2Constants.Properties.DefaultValues.InvokeInOrder);
    propertyBean.setMsgTypesToDrop(null);
    propertyBean.setRetransmissionInterval(Sandesha2Constants.Properties.DefaultValues.RetransmissionInterval);
    // propertyBean.setStorageManagerClass(Sandesha2Constants.Properties.DefaultValues.StorageManager);
    propertyBean.setInMemoryStorageManagerClass(Sandesha2Constants.Properties.DefaultValues.InMemoryStorageManager);
    propertyBean
        .setPermanentStorageManagerClass(Sandesha2Constants.Properties.DefaultValues.PermanentStorageManager);
    propertyBean
        .setMaximumRetransmissionCount(Sandesha2Constants.Properties.DefaultValues.MaximumRetransmissionCount);

    String msgTypesToDrop = Sandesha2Constants.Properties.DefaultValues.MessageTypesToDrop;
    loadMessageTypesToDrop(msgTypesToDrop, propertyBean);

    propertyBean.setSecurityManagerClass(Sandesha2Constants.Properties.DefaultValues.SecurityManager);
   
    propertyBean.setEnableMakeConnection(Sandesha2Constants.Properties.DefaultValues.EnableMakeConnection);
    propertyBean.setEnableRMAnonURI(Sandesha2Constants.Properties.DefaultValues.EnableRMAnonURI);
    propertyBean.setUseMessageSerialization(Sandesha2Constants.Properties.DefaultValues.UseMessageSerialization);
    propertyBean.setEnforceRM(Sandesha2Constants.Properties.DefaultValues.enforceRM);
   
    return propertyBean;
  }
View Full Code Here

   
    return propertyBean;
  }

  public static SandeshaPolicyBean loadPropertiesFromPropertyFile(InputStream in) throws SandeshaException {
    SandeshaPolicyBean propertyBean = new SandeshaPolicyBean();
    try {
      if (in == null)
        in = Thread.currentThread().getContextClassLoader().getResourceAsStream(
            Sandesha2Constants.PROPERTY_FILE);
View Full Code Here

    return propertyBean;
  }

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

TOP

Related Classes of org.apache.sandesha2.policy.SandeshaPolicyBean

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.