Package org.apache.axis2.description

Examples of org.apache.axis2.description.AxisOperation


                return;
            }

        // Get the UnmarshalInfo object.
        // This contains information from prior unmarshalling
        AxisOperation axisOp = mc.getAxisOperation();
        if (axisOp == null) {
            return;
        }
       
        Parameter parameterInfo = axisOp.getParameter(UnmarshalInfo.KEY);
        if (parameterInfo == null) {
            return;
        }
        UnmarshalInfo info =  (UnmarshalInfo) parameterInfo.getValue();
       
        if (info == null) {
            return;
        }
       
        // Crate a JAXBCustomBuilder and register it on the Axiom StAXOMBuilder
        JAXBDSContext jaxbDSC = new JAXBDSContext(info.getPackages(), info.getPackagesKey());
        jaxbDSC.setMessageContext(mc);
        JAXBCustomBuilder jcb = new JAXBCustomBuilder(jaxbDSC);
        ((StAXOMBuilder) envelope.getBuilder()).registerCustomBuilderForPayload(jcb);
        if (log.isDebugEnabled()) {
            log.debug("Registering JAXBCustomBuilder: " + jcb + " for AxisOperation: " + axisOp.getName());
        }
    }
View Full Code Here


            return null;
        }
       
        // This needs to be stored on the AxisOperation as unmarshalling
        // info will be specific to a method and its parameters
        AxisOperation axisOp = mc.getAxisMessageContext().getAxisOperation();
       
        Parameter param = axisOp.getParameter(UnmarshalInfo.KEY);
        return param;
    }
View Full Code Here

            return;
        }
       
        // This needs to be stored on the AxisOperation as unmarshalling
        // info will be specific to a method and its parameters
        AxisOperation axisOp = mc.getAxisMessageContext().getAxisOperation();
       
        // There are two things that need to be saved.
        // 1) The UnmarshalInfo object containing the packages
        //    (which will be used by the CustomBuilder)
        // 2) A MessageContextListener which (when triggered) registers
        //    the JAXBCustomBuilder
        Parameter param = axisOp.getParameter(UnmarshalInfo.KEY);
        if (param == null) {
            UnmarshalInfo info = new UnmarshalInfo(packages, packagesKey);
            axisOp.addParameter(UnmarshalInfo.KEY, info);
            param = axisOp.getParameter(UnmarshalInfo.KEY);
            param.setTransient(true);
            // Add a listener that will set the JAXBCustomBuilder
            UnmarshalMessageContextListener.
                create(mc.getAxisMessageContext().getServiceContext());
        }
View Full Code Here

     */
    public void migrateContextToThread(MessageContext messageContext)
            throws AxisFault {
        //Only make the context map available if we have an inbound request
        //message, in the server.
        AxisOperation axisOperation = messageContext.getAxisOperation();
        String mep = axisOperation.getMessageExchangePattern();
        int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
       
        if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
            mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
            mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.axis2.util.ThreadContextMigrator#cleanupThread(org.apache.axis2.context.MessageContext)
     */
    public void cleanupThread(MessageContext messageContext) {
        //Only clean up if we are inbound to the server.
        AxisOperation axisOperation = messageContext.getAxisOperation();
        String mep = axisOperation.getMessageExchangePattern();
        int mepConstant = Utils.getAxisSpecifMEPConstant(mep);
       
        if (mepConstant == WSDLConstants.MEP_CONSTANT_IN_ONLY ||
            mepConstant == WSDLConstants.MEP_CONSTANT_IN_OUT ||
            mepConstant == WSDLConstants.MEP_CONSTANT_IN_OPTIONAL_OUT ||
View Full Code Here

    newMessage.setServerSide(relatedMessage.isServerSide());

    // adding all parameters from old message to the new one.
    try {
      // axisOperation parameters
      AxisOperation oldAxisOperation = relatedMessage.getAxisOperation();
      if (oldAxisOperation != null) {
        ArrayList axisOpParams = oldAxisOperation.getParameters();
        if (axisOpParams != null) {
          AxisOperation newAxisOperation = newMessage.getAxisOperation();
          Iterator iter = axisOpParams.iterator();
          while (iter.hasNext()) {
            Parameter nextParam = (Parameter) iter.next();
            Parameter newParam = new Parameter();

            newParam.setName(nextParam.getName());
            newParam.setValue(nextParam.getValue());

            newAxisOperation.addParameter(newParam);
          }
        }
      }

    } catch (AxisFault e) {
View Full Code Here

    MessageContext createSeqmsgContext;
    try {
      // creating by copying common contents. (this will not set contexts
      // except for configCtx).
      AxisOperation createSequenceOperation = applicationMsgContext.getAxisService()
            .getOperation(new QName (Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
       
      if (createSequenceOperation==null
        createSequenceOperation = AxisOperationFactory
          .getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_OUT_IN);

      createSeqmsgContext = SandeshaUtil
          .createNewRelatedMessageContext(applicationRMMsg, createSequenceOperation);
     
      initializeCreation(applicationMsgContext, createSeqmsgContext);

      OperationContext createSeqOpCtx = createSeqmsgContext.getOperationContext();
      String createSeqMsgId = SandeshaUtil.getUUID();
      createSeqmsgContext.setMessageID(createSeqMsgId);
      context.registerOperationContext(createSeqMsgId, createSeqOpCtx);

    } catch (AxisFault e) {
      throw new SandeshaException(e.getMessage());
    }

    AxisOperation appMsgOperationDesc = applicationMsgContext.getAxisOperation();

    AxisOperation createSeqOperation = createSeqmsgContext.getAxisOperation();

    createSeqOperation.setName(new QName(Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
    if (appMsgOperationDesc != null) {
      createSeqOperation.setPhasesOutFlow(appMsgOperationDesc.getPhasesOutFlow());
      createSeqOperation.setPhasesOutFaultFlow(appMsgOperationDesc.getPhasesOutFaultFlow());
      createSeqOperation.setPhasesInFaultFlow(appMsgOperationDesc.getPhasesInFaultFlow());
      createSeqOperation.setRemainingPhasesInFlow(appMsgOperationDesc.getRemainingPhasesInFlow());
    }

    createSeqmsgContext.setAxisOperation(createSeqOperation);
           
    RMMsgContext createSeqRMMsg = new RMMsgContext(createSeqmsgContext);
View Full Code Here

      String sequencePropertyKey, StorageManager storageManager) throws AxisFault {
    MessageContext referenceMessage = referenceRMMessage.getMessageContext();
    if (referenceMessage == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.msgContextNotSet));

    AxisOperation terminateOperation = referenceMessage.getAxisService().getOperation(new QName (Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));

    try {
      if (terminateOperation==null)
        terminateOperation = AxisOperationFactory.getAxisOperation(WSDL20_2004Constants.MEP_CONSTANT_OUT_ONLY);
    } catch (AxisFault e1) {
      throw new SandeshaException(e1.getMessage());
    }

    if (terminateOperation == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.terminateOpperationIsNull));

    ConfigurationContext configCtx = referenceMessage.getConfigurationContext();
    if (configCtx == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.configContextNotSet));

    MessageContext terminateMessage = SandeshaUtil.createNewRelatedMessageContext(referenceRMMessage,
        terminateOperation);

    OperationContext operationContext = terminateMessage.getOperationContext();
    configCtx.registerOperationContext(terminateMessage.getMessageID(), operationContext); // to
                                                // receive
                                                // terminate
                                                // sequence
                                                // response
                                                // messages
                                                // correctly.

    //using the Sandesha2 RMOutInOperation as the reference operation.
    AxisOperation referenceOperation = referenceMessage.getAxisService()
          .getOperation(new QName (Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
   
    AxisOperation terminateMsgOperation = terminateMessage.getAxisOperation();
    if (referenceOperation != null) {
      terminateMsgOperation.setPhasesOutFlow(referenceOperation.getPhasesOutFlow());
      terminateMsgOperation.setPhasesOutFaultFlow(referenceOperation.getPhasesOutFaultFlow());
      terminateMsgOperation.setPhasesInFaultFlow(referenceOperation.getPhasesInFaultFlow());
      terminateMsgOperation.setRemainingPhasesInFlow(referenceOperation.getRemainingPhasesInFlow());
    }

    String rmVersion = SandeshaUtil.getRMVersion(sequencePropertyKey, storageManager);
    if (rmVersion == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));

    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmVersion);

    initializeCreation(referenceMessage, terminateMessage);

    if (!SpecSpecificConstants.isTerminateSequenceResponseRequired(rmVersion)) {
      terminateMessage.setProperty(MessageContext.TRANSPORT_IN, null);
    }

    RMMsgContext terminateRMMessage = MsgInitializer.initializeMessage(terminateMessage);

    if (terminateMessage == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.msgContextNotSet));

    // setUpMessage(referenceMessage, terminateMessage);

    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(referenceMessage
        .getEnvelope()));

    terminateMessage.setMessageID(SandeshaUtil.getUUID());

    AxisOperation referenceMsgOperation = referenceMessage.getAxisOperation();
    if (referenceMsgOperation != null) {
      ArrayList outPhases = referenceMsgOperation.getPhasesOutFlow();
      if (outPhases != null) {
        terminateOperation.setPhasesOutFlow(outPhases);
        terminateOperation.setPhasesOutFaultFlow(outPhases);
      }
    }
View Full Code Here

   
    MessageContext referenceMessage = referenceRMMessage.getMessageContext();
    String rmNamespaceValue = referenceRMMessage.getRMNamespaceValue();
    String rmVersion = referenceRMMessage.getRMSpecVersion();
   
    AxisOperation makeConnectionOperation = referenceMessage.
            getAxisService().getOperation(new QName (Sandesha2Constants.RM_IN_OUT_OPERATION_NAME));
     
    makeConnectionOperation = AxisOperationFactory.getAxisOperation(
        WSDL20_2004Constants.MEP_CONSTANT_OUT_IN);
   
View Full Code Here

        AxisService axisService = parentEndpointDescription.getAxisService();
        if (axisService != null) {
            ArrayList publishedOperations = axisService.getPublishedOperations();
            Iterator operationsIterator = publishedOperations.iterator();
            while (operationsIterator.hasNext()) {
                AxisOperation axisOperation = (AxisOperation)operationsIterator.next();
                addOperation(new OperationDescriptionImpl(axisOperation, this));
            }
        }
    }
View Full Code Here

TOP

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

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.