Package flex.management.runtime.messaging.services.remoting

Examples of flex.management.runtime.messaging.services.remoting.RemotingDestinationControl


        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)
                    {                       
                        // Record a successful invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationSuccessCount((int)(System.currentTimeMillis() - startTime));
                    }
                   
                    return result;
                }
                catch (MessageException ex)
                {
                    if (destinationControl != null)
                    {                       
                        // Record a faulted invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
                    }
                   
                    throw ex;
                }
                catch (Throwable t)
                {
                    if (destinationControl != null)
                    {                       
                        // Record a faulted invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
                    }
                   
                    throw new MessageException(t);
                }
            }
View Full Code Here


     *
     * @param service The <code>Service</code> that manages this <code>RemotingDestination</code>.
     */
    protected void setupDestinationControl(Service service)
    {
        controller = new RemotingDestinationControl(this, service.getControl());
        controller.register();
        setControl(controller);
    }
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)
                    {
                        // Record a successful invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationSuccessCount((int)(System.currentTimeMillis() - startTime));
                    }

                    return result;
                }
                catch (MessageException ex)
                {
                    if (destinationControl != null)
                    {
                        // Record a faulted invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
                    }

                    throw ex;
                }
                catch (Throwable t)
                {
                    if (destinationControl != null)
                    {
                        // Record a faulted invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
                    }

                    throw new MessageException(t);
                }
            }
View Full Code Here

     *
     * @param service The <code>Service</code> that manages this <code>RemotingDestination</code>.
     */
    protected void setupDestinationControl(Service service)
    {
        controller = new RemotingDestinationControl(this, service.getControl());
        controller.register();
        setControl(controller);
    }
View Full Code Here

TOP

Related Classes of flex.management.runtime.messaging.services.remoting.RemotingDestinationControl

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.