Package org.apache.sandesha2.policy

Examples of org.apache.sandesha2.policy.SandeshaPolicyBean


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 static boolean hasSequenceTimedOut(String propertyKey, RMMsgContext rmMsgCtx, StorageManager storageManager)
      throws SandeshaException {

    // operation is the lowest level, Sandesha2 could be engaged.
    SandeshaPolicyBean propertyBean = SandeshaUtil.getPropertyBean(rmMsgCtx.getMessageContext()
        .getAxisOperation());

    if (propertyBean.getInactivityTimeoutInterval() <= 0)
      return false;

    boolean sequenceTimedOut = false;

    long lastActivatedTime = getLastActivatedTime(propertyKey, storageManager);
    long timeNow = System.currentTimeMillis();
    if (lastActivatedTime > 0 && (lastActivatedTime + propertyBean.getInactivityTimeoutInterval() < timeNow))
      sequenceTimedOut = true;

    return sequenceTimedOut;
  }
View Full Code Here

    rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID, sequenceID);
   
    String sequencePropertyKey = SandeshaUtil.getSequencePropertyKey(rmMsgCtx);
   
    // operation is the lowest level Sandesha2 could be attached.
    SandeshaPolicyBean propertyBean = SandeshaUtil.getPropertyBean(rmMsgCtx.getMessageContext().getAxisOperation());

    retransmitterBean.setSentCount(retransmitterBean.getSentCount() + 1);
    adjustNextRetransmissionTime(retransmitterBean, propertyBean);

    int maxRetransmissionAttempts = propertyBean.getMaximumRetransmissionCount();

    boolean timeOutSequence = false;
    if (maxRetransmissionAttempts >= 0 && retransmitterBean.getSentCount() > maxRetransmissionAttempts)
      timeOutSequence = true;
View Full Code Here

        super ("StorageMapBeanMgrTest");
    }

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

        super("SequencePropertyBeanMgrTest");
    }

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

    }

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

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

        super("RetransmitterBeanMgrTest");
    }

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

      // checking if policies hv been set to enforceRM.
      // If this is set and this message is not an RM message, validation
      // will fail here.

      SandeshaPolicyBean propertyBean = SandeshaUtil
          .getPropertyBean(rmMsg.getMessageContext()
              .getAxisOperation());
      if (propertyBean.isEnforceRM()) {
        String message = SandeshaMessageHelper.getMessage(
            SandeshaMessageKeys.rmEnforceFailure, rmMsg
                .getMessageId());
        throw new SandeshaException(message);
      }
View Full Code Here

  public InMemoryStorageManager(ConfigurationContext context)
  throws SandeshaException
  {
    super(context);
   
    SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(context.getAxisConfiguration());
    useSerialization = policy.isUseMessageSerialization();
   
    // Note that while inOrder is a global property we can decide if we need the
    // invoker thread at this point. If we change this to be a sequence-level
    // property then we'll need to revisit this.
    boolean inOrder = policy.isInOrder();
    boolean polling = policy.isEnableMakeConnection();
   
    this.rMSBeanMgr = new InMemoryRMSBeanMgr (this, context);
    this.rMDBeanMgr = new InMemoryRMDBeanMgr (this, context);
    this.senderBeanMgr = new InMemorySenderBeanMgr (this, context);
    this.invokerBeanMgr = new InMemoryInvokerBeanMgr (this, context);
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.