Package org.jboss.soa.esb.addressing

Examples of org.jboss.soa.esb.addressing.PortReference


   * @deprecated
   */
 
  public void setURL (URL url)
  {
    super.setAddr(new PortReference(url.toString()));
  }
View Full Code Here


        }
      }
    }
    if (uri != null) {
      final String address = getJmsAddress(uri, name) ;
      setAddr(new PortReference(address));
    }
  }
View Full Code Here

      if (destinationType.equals(QUEUE_TYPE)
          || destinationType.equals(TOPIC_TYPE))
      {
        String uri = null;
        String name = null;
        PortReference addr = new PortReference();
       
                if (environment!=null) {
                    for (Object key : environment.keySet()) {
                      if (key.toString().equals(JNDI_URL_TAG))
                        uri = environment.getProperty(key.toString());
                      else
                      {
                        if (key.toString().equals(DESTINATION_NAME_TAG))
                        {
                          name = environment.getProperty(key.toString());
                         
                          if ((destinationName != null) && !name.equals(destinationName))
                            throw new IllegalArgumentException("Destination name inconsistency: < "+name+", "+destinationName+" >");
                        }
                        else
                          addr.addExtension(key.toString(), environment.getProperty(key.toString()));
                      }
                    }
                }
               
                if (uri == null) {
                    uri = addr.getExtensionValue(Context.PROVIDER_URL) ;
                }
               
                if (uri == null) {
                    uri = Configuration.getJndiServerURL() ;
                }
 
                if (name == null)
                  name = destinationName;
               
                addr.setAddress(getJmsAddress(uri, name));

        addr.addExtension(DESTINATION_TYPE_TAG, destinationType);
        addr.addExtension(DESTINATION_NAME_TAG, destinationName);
       
        addr.addExtension(SPECIFICATION_VERSION_TAG, protocol);

        if (connection != null)
          addr.addExtension(CONNECTION_FACTORY_TAG, connection);

        if (messageSelector != null)
          addr.addExtension(MESSAGE_SELECTOR_TAG, messageSelector);
               
        addr.addExtension(PERSISTENT_TAG, String.valueOf(peristent));
       
        addr.addExtension(ACKNOWLEDGE_MODE_TAG, String.valueOf(AcknowledgeMode.getAckMode(acknowledgeModeStr)));
       
        setAddr(addr);
       
        if(username != null)
          addr.addExtension(JMS_SECURITY_PRINCIPAL_TAG, username);
       
        if(password != null)
          addr.addExtension(JMS_SECURITY_CREDENTIAL_TAG, password);
       
        addr.addExtension(TRANSACTED_TAG, String.valueOf(transacted));
      }
      else
        throw new IllegalArgumentException("Invalid destination type! "+destinationType);
    }
    else
View Full Code Here

     * @return the replyTo EPR of the JBpmCallbackService.
     */
    protected EPR createReplyTo(String esbToJBpmXml, Boolean globalProcessScope, ExecutionContext executionContext)
    {
        EPR replyTo = new LogicalEPR(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, JBpmCallback.JBPM_CALL_BACK_SERVICE_NAME);
        PortReference portReference = replyTo.getAddr();
        if (globalProcessScope!=null) {
            portReference.addExtension(Constants.PROCESS_SCOPE_ATTR, globalProcessScope.toString());
        }
        final Token token = executionContext.getToken() ;
        final long tokenId = token.getId();
        portReference.addExtension(Constants.TOKEN_ID, String.valueOf(tokenId));
        String nodeId = "";
        if (executionContext.getNode()!=null) {
            nodeId = String.valueOf(executionContext.getNode().getId());
            portReference.addExtension(Constants.NODE_ID, nodeId);
           
        }
        portReference.addExtension(Constants.PROCESS_INSTANCE_ID, String.valueOf(executionContext.getProcessInstance().getId()));
       
        String counterName = Constants.PROCESS_NODE_VERSION_COUNTER  + nodeId + '_' + tokenId;
        Long counter = Long.getLong(String.valueOf(executionContext.getVariable(counterName)));
        if (counter!=null) {
            counter = counter + 1;
        } else {
            counter = 0l;
        }
        //Adding to the jBPM variableMap
        executionContext.getContextInstance().setVariableLocally(counterName, counter.toString(), token);
        //Adding same value to the message
        portReference.addExtension(counterName, counter.toString());
        return replyTo;
    }
View Full Code Here

     */
    protected EPR createFaultTo(String esbToJBpmXml, Boolean globalProcessScope, ExecutionContext executionContext)
    {
        EPR faultTo = createReplyTo(esbToJBpmXml, globalProcessScope, executionContext);
        if (!exceptionTransition.equals("condition")) {
            PortReference portReference = faultTo.getAddr();
            portReference.addExtension(Constants.TRANSITION_NAME, exceptionTransition);
        }
        return faultTo;
    }
View Full Code Here

   
    public Object execute(JbpmContext jbpmContext)
    {
        final boolean isDebugEnabled = logger.isDebugEnabled() ;
        try {
            PortReference portRef = callbackEpr.getAddr();
            long nodeId  = Long.parseLong(portRef.getExtensionValue(Constants.NODE_ID));
            long tokenId = Long.parseLong(portRef.getExtensionValue(Constants.TOKEN_ID));
            long processInstanceId = Long.parseLong(portRef.getExtensionValue(Constants.PROCESS_INSTANCE_ID));
           
            String counterName = Constants.PROCESS_NODE_VERSION_COUNTER + nodeId + '_' + tokenId;
           
            long processNodeVersion = Long.parseLong(portRef.getExtensionValue(counterName));
           
            if (isDebugEnabled) logger.debug("Expected nodeId=" + nodeId +  ", tokenId=" + tokenId + ", processNodeVersion=" + processNodeVersion);
            //get update on current state of things.
            final Token token = jbpmContext.getToken(tokenId) ;
            if (token == null) {
                throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer active") ;
            }
           
            final ProcessInstance instance = token.getProcessInstance() ;
            if (instance == null) {
                throw new CallbackException("Process instance " + processInstanceId + " is no longer active") ;
            }
           
            if (instance.getId() != processInstanceId) {
                throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " now attached to process instance " + instance.getId()) ;
            }
           
            if (nodeId != token.getNode().getId()) {
                throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is no longer on expected node, expected " + nodeId + " but discovered " + token.getNode().getId()) ;
            }
            if (token.hasEnded()) {
                throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " has already terminated") ;
            }
           
            if (token.isLocked()) {
                throw new CallbackException("Token id " + tokenId + " from process instance " + processInstanceId + " is already locked, another thread is active") ;
            }
           
            final ContextInstance contextInstance = instance.getContextInstance() ;
            final long currentProcessNodeVersion = Long.parseLong(String.valueOf(contextInstance.getVariableLocally(counterName, token)));
            if (isDebugEnabled) logger.debug("ProcessNodeVersion=" + currentProcessNodeVersion);
            if (processNodeVersion!=currentProcessNodeVersion) {
                throw new CallbackException("The current processNodeVersion (id=" + currentProcessNodeVersion + ") is not the expected version (version=" + processNodeVersion + ").");
            }
           
            final String globalProcessScopeVal = portRef.getExtensionValue(Constants.PROCESS_SCOPE_ATTR) ;
            // Default to global scope as that matches the previous functionality
            // N.B. This is different from retrieving variables!!
            final boolean globalProcessScope = (globalProcessScopeVal == null ? true : Boolean.parseBoolean(globalProcessScopeVal));
           
            Map<Mapping, Object> variablesMap = getVariablesMapFromMessage(token.getNode(), message);
View Full Code Here

        parse(in) ;
       
        if (extensions.size() > 0)
        {
            final EPR origEPR = call.getTo() ;
            final PortReference to = origEPR.getAddr() ;
            for(NamedElement element: extensions)
            {
                final QName name = element.getName() ;
                final TextElement content = (TextElement)element.getElementContent() ;
                to.addExtension(name.getLocalPart(), name.getPrefix(), name.getNamespaceURI(), content.getText()) ;
            }
           
            call.setTo(EPRHelper.getSpecificEPR(origEPR)) ;
        }
    }
View Full Code Here

   * @deprecated
   */
 
  public final void setURL (URL url)
  {
    super.setAddr(new PortReference(url.toString()));
  }
View Full Code Here

    if ((protocol == null) || (host == null) || (port == null))
      throw new IllegalArgumentException();
   
    if ((protocol.equals(SMTP_PROTOCOL) || (protocol.equals(POP_PROTOCOL))))
    {
      PortReference addr = new PortReference(protocol+PROTOCOL_SEPARATOR+host+PORT_SEPARATOR+port);
     
      if (username != null)
        addr.addExtension(USERNAME_TAG, username);
     
      if (password != null)
        addr.addExtension(PASSWORD_TAG, password);
     
      setAddr(addr);
    }
    else
      throw new IllegalArgumentException("Invalid email protocol!");
View Full Code Here

   * @param url the address.
   */
 
  public final void setURL (String url)
  {
    super.setAddr(new PortReference(url));
  }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.addressing.PortReference

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.