Package org.apache.sandesha2.policy

Examples of org.apache.sandesha2.policy.SandeshaPolicyBean


    rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceID);
    rmMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.SEQUENCE_ID, sequenceID);
   
    // 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();
   
    // We can only time out sequences if we can identify the correct sequence, and
    // we need the internal sequence id for that.
    boolean continueSending = true;
    if(internalSequenceID != null) {
View Full Code Here


    rmsBean.setSequenceID(newOutSequenceId);

    // We should poll for any reply-to that uses the anonymous URI, when MakeConnection
    // is enabled.
    if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configCtx.getAxisConfiguration());
      if(policy.isEnableMakeConnection()) {
        String acksTo = rmsBean.getAcksToEPR();
        EndpointReference reference = new EndpointReference(acksTo);
        if(acksTo == null || reference.hasAnonymousAddress()) {
          rmsBean.setPollingMode(true);
        }
View Full Code Here

  public static boolean hasSequenceTimedOut(RMSBean rmsBean, String internalSequenceId, StorageManager storageManager)
      throws SandeshaException {

    //FIXME - get this policy from the service level.
    SandeshaPolicyBean propertyBean =
      SandeshaUtil.getPropertyBean(storageManager.getContext().getAxisConfiguration());

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

    boolean sequenceTimedOut = false;
   
    long lastActivatedTime = rmsBean.getLastActivatedTime();
    long timeNow = System.currentTimeMillis();
    if (lastActivatedTime > 0 && (lastActivatedTime + propertyBean.getInactivityTimeoutInterval() < timeNow))
      sequenceTimedOut = true;

    return sequenceTimedOut;
  }
View Full Code Here

      boolean responseWritten = TransportUtils.isResponseWritten(msgCtx);
      if (!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

        }
        if(specVersion == Sandesha2Constants.SPEC_VERSIONS.v1_1) {
          EndpointReference replyTo = msgContext.getReplyTo();
          if(replyTo == null || replyTo.hasAnonymousAddress()) {
            //we are sync
            SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configContext.getAxisConfiguration());
            if(!policy.isEnableMakeConnection()) {
              String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionDisabled);
              throw new SandeshaException(message);
            }           
          }
        }
View Full Code Here

    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

    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

      log.debug("Enter: SandeshaUtil::executeAndStore, " + storageKey);
   
    MessageContext msgContext = rmMsgContext.getMessageContext();
    ConfigurationContext configurationContext = msgContext.getConfigurationContext();

    SandeshaPolicyBean policy = getPropertyBean(msgContext.getAxisOperation());
    if(policy.isUseMessageSerialization()) {
      msgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_TRUE);

      StorageManager store = getSandeshaStorageManager(configurationContext, configurationContext.getAxisConfiguration());
      store.storeMessageContext(storageKey, msgContext);
     
View Full Code Here

   
    Object property = message.getProperty(Sandesha2Constants.RETRANSMITTABLE_PHASES);
    if (property!=null)
      return; //Phases are already set. Dont hv to redo.
   
    SandeshaPolicyBean policy = getPropertyBean(message.getAxisOperation());
    if(policy.isUseMessageSerialization())
      return; // No need to mess with the transport when we use message serialization
   
    TransportOutDescription transportOutDescription = message.getTransportOut();
    if (!(transportOutDescription instanceof Sandesha2TransportOutDesc))
      return; //This message is aimed to be stored only if, Sandesha2TransportOutDescription is set.
View Full Code Here

  throws SandeshaException
  {
    if (log.isDebugEnabled())
      log.debug("Enter: SandeshaUtil::rewriteEPR " + epr);

    SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configContext.getAxisConfiguration());
    if(!policy.isEnableRMAnonURI()) {
      if (log.isDebugEnabled())
        log.debug("Exit: SandeshaUtil::rewriteEPR, anon uri is disabled");
      return epr;
    }
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.