Package flex.messaging.messages

Examples of flex.messaging.messages.RemotingMessage


    /**
     * Creates a Flex 2+ RemotingMessage from a legacy AMF message.
     */
    private RemotingMessage createMessage(MessageBody messageBody, Object body, Map headerMap)
    {
        RemotingMessage remotingMessage = new RemotingMessage();
        // MessageBroker expects non-null messageId and we don't need to
        // incur the cost of generating a UUID value so assigning empty string.
        remotingMessage.setMessageId("");
        remotingMessage.setBody(body);
        remotingMessage.setHeaders(headerMap);

        // Decode legacy target URI; format is "destination.operation"
        String targetURI = messageBody.getTargetURI();

        int dotIndex = targetURI.lastIndexOf(".");
        if (dotIndex > 0)
        {
            String destination = targetURI.substring(0, dotIndex);
            remotingMessage.setDestination(destination);
        }

        if (targetURI.length() > dotIndex)
        {
            String operation = targetURI.substring(dotIndex + 1);
            remotingMessage.setOperation(operation);
        }

        return remotingMessage;
    }
View Full Code Here


    }


    private RemotingMessage createMessage(MessageBody messageBody, Object body, Map headerMap)
    {
        RemotingMessage remotingMessage = new RemotingMessage();
        // Assigning an empty String, MessageBroker expects non-null messageId.       
        remotingMessage.setMessageId("")
        remotingMessage.setBody(body);
        remotingMessage.setHeaders(headerMap);

        // Decode legacy target URI into destination.operation
        String targetURI = messageBody.getTargetURI();

        int dotIndex = targetURI.lastIndexOf(".");
        if (dotIndex > 0)
        {
            String destination = targetURI.substring(0, dotIndex);
            remotingMessage.setDestination(destination);
        }

        if (targetURI.length() > dotIndex)
        {
            String operation = targetURI.substring(dotIndex + 1);
            remotingMessage.setOperation(operation);
        }

        return remotingMessage;
    }
View Full Code Here

  public Object invoke(ServiceAdapter serviceAdapter, Message message){
   
   
        //RemotingDestination remotingDestination = (RemotingDestination)serviceAdapter.getDestination();
        RemotingMessage remotingMessage = (RemotingMessage)message;
        //FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();
        /*
        print.out("className:"+remotingMessage.getSource());
        print.out("methodName:"+remotingMessage.getOperation());
        print.out("params:");
        print.out(remotingMessage.getParameters().toArray());
         */     
        try {
      Object rtn = new CFMLProxy().invokeBody(
          null,properties,
          FlexContext.getServletContext(),
          FlexContext.getServletConfig(),
          FlexContext.getHttpRequest(),
          FlexContext.getHttpResponse(),
          remotingMessage.getSource(),
          remotingMessage.getOperation(),
          remotingMessage.getParameters());
     
          return rtn;
    }
        catch (Exception e) {
          e.printStackTrace();// TODO
View Full Code Here

    //--------------------------------------------------------------------------

    public Object invoke(Message message)
    {
        RemotingDestination remotingDestination = (RemotingDestination)getDestination();
        RemotingMessage remotingMessage = (RemotingMessage)message;
        FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();

        // We don't allow the client to specify the source for
        // Java based services.
        String className = factoryInstance.getSource();
        remotingMessage.setSource(className);

        String methodName = remotingMessage.getOperation();
        List parameters = remotingMessage.getParameters();
        Object result = null;

        try
        {
            // Test that the target method may be invoked based upon include/exclude method settings.
View Full Code Here

        }
        */

        if (msg instanceof RemotingMessage)
        {
            RemotingMessage message = (RemotingMessage)msg;
            RemotingDestination destination = (RemotingDestination)getDestination(msg);
            RemotingDestinationControl destinationControl = (destination.isManaged()) ? (RemotingDestinationControl)destination.getControl() : null;               

            if (destination != null)
            {
                ServiceAdapter adapter = destination.getAdapter();
                long startTime = 0;
                if (destinationControl != null)
                    startTime = System.currentTimeMillis();
                try
                {
                  MessagePerformanceUtils.markServerPreAdapterTime(message);
                    Object result = adapter.invoke(message);
                  MessagePerformanceUtils.markServerPostAdapterTime(message);                   

                    if (Log.isDebug())
                    {
                        Log.getLogger(LOG_CATEGORY).debug("Adapter '{0}' called '{1}.{2}({3})'",
                                new Object[] {adapter.getId(),
                                              message.getSource(),
                                              message.getOperation(),
                                              message.getParameters()});
                        Log.getLogger(LOG_CATEGORY).debug("Result: '{0}'", new Object[] {result});
                    }

                    if (destinationControl != null)
                    {                       
View Full Code Here

    }


    private RemotingMessage createMessage(MessageBody messageBody, Object body, Map headerMap)
    {
        RemotingMessage remotingMessage = new RemotingMessage();
        // Assigning an empty String, MessageBroker expects non-null messageId.       
        remotingMessage.setMessageId("")
        remotingMessage.setBody(body);
        remotingMessage.setHeaders(headerMap);

        // Decode legacy target URI into destination.operation
        String targetURI = messageBody.getTargetURI();

        int dotIndex = targetURI.lastIndexOf(".");
        if (dotIndex > 0)
        {
            String destination = targetURI.substring(0, dotIndex);
            remotingMessage.setDestination(destination);
        }

        if (targetURI.length() > dotIndex)
        {
            String operation = targetURI.substring(dotIndex + 1);
            remotingMessage.setOperation(operation);
        }

        return remotingMessage;
    }
View Full Code Here

        }
        */

        if (msg instanceof RemotingMessage)
        {
            RemotingMessage message = (RemotingMessage)msg;
            RemotingDestination destination = (RemotingDestination)getDestination(msg);
            RemotingDestinationControl destinationControl = (destination.isManaged()) ? (RemotingDestinationControl)destination.getControl() : null;

            if (destination != null)
            {
                ServiceAdapter adapter = destination.getAdapter();
                long startTime = 0;
                if (destinationControl != null)
                    startTime = System.currentTimeMillis();
                try
                {
                    MessagePerformanceUtils.markServerPreAdapterTime(message);
                    Object result = adapter.invoke(message);
                    MessagePerformanceUtils.markServerPostAdapterTime(message);

                    if (Log.isDebug())
                    {
                        Log.getLogger(LOG_CATEGORY).debug("Adapter '{0}' called '{1}.{2}({3})'",
                                new Object[] {adapter.getId(),
                                              message.getSource(),
                                              message.getOperation(),
                                              message.getParameters()});
                        Log.getLogger(LOG_CATEGORY).debug("Result: '{0}'", new Object[] {result});
                    }

                    if (destinationControl != null)
                    {
View Full Code Here

    /** {@inheritDoc} */
    public Object invoke(Message message)
    {
        RemotingDestination remotingDestination = (RemotingDestination)getDestination();
        RemotingMessage remotingMessage = (RemotingMessage)message;
        FactoryInstance factoryInstance = remotingDestination.getFactoryInstance();

        // We don't allow the client to specify the source for
        // Java based services.
        String className = factoryInstance.getSource();
        remotingMessage.setSource(className);

        String methodName = remotingMessage.getOperation();
        List parameters = remotingMessage.getParameters();
        Object result = null;

        try
        {
            // Test that the target method may be invoked based upon include/exclude method settings.
View Full Code Here

      amfConnection.connect("http://localhost/PHPArray-debug/gateway.php");
    } catch (ClientStatusException e1) {
      e1.printStackTrace();
    }
    
    RemotingMessage message = new RemotingMessage();
    message.setMessageId(flex.messaging.util.UUIDUtils.createUUID());
    message.setOperation("testarray");
    message.setBody(args1);
    message.setSource("PHPSvc");
    message.setDestination("PHPSvc");
   
        amfConnection.setObjectEncoding(3);
        amfConnection.setInstantiateTypes(false);
   
    Object returnValue = null;
View Full Code Here

TOP

Related Classes of flex.messaging.messages.RemotingMessage

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.