Package org.eclipse.persistence.sessions.coordination

Examples of org.eclipse.persistence.sessions.coordination.Command


    public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream)_in;
            if (method.equals("executeCommand")) {
                Command arg0 = (Command)in.read_value(Command.class);
                Object result = target.executeCommand(arg0);
                OutputStream out = reply.createReply();
                Util.writeAny(out, result);
                return out;
            }
View Full Code Here


     * Process the object extracted from the received message.
     * Pass to this method messageInfo created by logDebugOnReceiveMessage method.
     * This method is used by local (listening) connection only.
     */
    protected void processReceivedObject(Object object, String messageId) {
        Command remoteCommand = null;
        if (object instanceof Command) {
            remoteCommand = (Command)object;
            try {
                // prevent the processing of messages sent with the same serviceId
                if (shouldCheckServiceId()) {
                    if (remoteCommand.getServiceId().getId().equals(this.serviceId.getId())) {
                        return;
                    }
                }
                if (remoteCommand.getServiceId().getChannel().equals(this.serviceId.getChannel())) {
                    if(rcm.shouldLogDebugMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand) };
                        rcm.logDebugWithoutLevelCheck("broadcast_processing_remote_command", args);
                    }
                    rcm.processCommandFromRemoteConnection(remoteCommand);
                } else {
                    if(rcm.shouldLogWarningMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand)};
                        rcm.logWarningWithoutLevelCheck("broadcast_ignore_remote_command_from_different_channel", args);
                    }
                }
            } catch (RuntimeException e) {
                try {
                    rcm.handleException(RemoteCommandManagerException.errorProcessingRemoteCommand(toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand), e));
                } catch (RuntimeException ex) {
                    // User had a chance to handle the exception.
                    // The method is called by a listener thread - no one could catch this exception.
                }
            }
View Full Code Here

     *
     */
    public static byte[] processCommand(byte[] command, RemoteCommandManager aRCM) {
        try {
            // deserialize byte [] to Command object
            Command deserializedCmd = (Command)SerializationHelper.deserialize(command);

            aRCM.processCommandFromRemoteConnection(deserializedCmd);
        } catch (Exception e) {
            // Log the problem encountered during deserialization or rcm processing command
            Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
View Full Code Here

    public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream)_in;
            if (method.equals("executeCommand")) {
                Command arg0 = (Command)in.read_value(Command.class);
                Object result = target.executeCommand(arg0);
                OutputStream out = reply.createReply();
                Util.writeAny(out, result);
                return out;
            }
View Full Code Here

     *
     */
    public static byte[] processCommand(byte[] command, RemoteCommandManager aRCM) {
        try {
            // deserialize byte [] to Command object
            Command deserializedCmd = (Command)SerializationHelper.deserialize(command);

            aRCM.processCommandFromRemoteConnection(deserializedCmd);
        } catch (Exception e) {
            // Log the problem encountered during deserialization or rcm processing command
            Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
View Full Code Here

     * Process the object extracted from the received message.
     * Pass to this method messageInfo created by logDebugOnReceiveMessage method.
     * This method is used by local (listening) connection only.
     */
    protected void processReceivedObject(Object object, String messageId) {
        Command remoteCommand = null;
        if (object instanceof Command) {
            remoteCommand = (Command)object;
            try {
                // prevent the processing of messages sent with the same serviceId
                if (shouldCheckServiceId()) {
                    if (remoteCommand.getServiceId().getId().equals(this.serviceId.getId())) {
                        return;
                    }
                }
                if (remoteCommand.getServiceId().getChannel().equals(this.serviceId.getChannel())) {
                    if(rcm.shouldLogDebugMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand) };
                        rcm.logDebugWithoutLevelCheck("broadcast_processing_remote_command", args);
                    }
                    rcm.processCommandFromRemoteConnection(remoteCommand);
                } else {
                    if(rcm.shouldLogWarningMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand)};
                        rcm.logWarningWithoutLevelCheck("broadcast_ignore_remote_command_from_different_channel", args);
                    }
                }
            } catch (RuntimeException e) {
                try {
                    rcm.handleException(RemoteCommandManagerException.errorProcessingRemoteCommand(toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand), e));
                } catch (RuntimeException ex) {
                    // User had a chance to handle the exception.
                    // The method is called by a listener thread - no one could catch this exception.
                }
            }
View Full Code Here

    public OutputStream _invoke(String method, InputStream _in, ResponseHandler reply) throws SystemException {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream)_in;
            if (method.equals("executeCommand")) {
                Command arg0 = (Command)in.read_value(Command.class);
                Object result = target.executeCommand(arg0);
                OutputStream out = reply.createReply();
                Util.writeAny(out, result);
                return out;
            }
View Full Code Here

     *
     */
    public static byte[] processCommand(byte[] command, RemoteCommandManager aRCM) {
        try {
            // deserialize byte [] to Command object
            Command deserializedCmd = (Command)SerializationHelper.deserialize(command);

            aRCM.processCommandFromRemoteConnection(deserializedCmd);
        } catch (Exception e) {
            // Log the problem encountered during deserialization or rcm processing command
            Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
View Full Code Here

     * Process the object extracted from the received message.
     * Pass to this method messageInfo created by logDebugOnReceiveMessage method.
     * This method is used by local (listening) connection only.
     */
    protected void processReceivedObject(Object object, String messageId) {
        Command remoteCommand = null;
        if (object instanceof Command) {
            remoteCommand = (Command)object;
            try {
                // prevent the processing of messages sent with the same serviceId
                if (shouldCheckServiceId()) {
                    if (remoteCommand.getServiceId().getId().equals(this.serviceId.getId())) {
                        return;
                    }
                }
                if (remoteCommand.getServiceId().getChannel().equals(this.serviceId.getChannel())) {
                    if(rcm.shouldLogDebugMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand) };
                        rcm.logDebugWithoutLevelCheck("broadcast_processing_remote_command", args);
                    }
                    rcm.processCommandFromRemoteConnection(remoteCommand);
                } else {
                    if(rcm.shouldLogWarningMessage()) {
                        Object[] args = { toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand)};
                        rcm.logWarningWithoutLevelCheck("broadcast_ignore_remote_command_from_different_channel", args);
                    }
                }
            } catch (RuntimeException e) {
                try {
                    rcm.handleException(RemoteCommandManagerException.errorProcessingRemoteCommand(toString(), messageId, remoteCommand.getServiceId().toString(), Helper.getShortClassName(remoteCommand), e));
                } catch (RuntimeException ex) {
                    // User had a chance to handle the exception.
                    // The method is called by a listener thread - no one could catch this exception.
                }
            }
View Full Code Here

        try {
            if (rcm.getSerializer() != null) {
                rcm.processCommandFromRemoteConnection(command);               
            } else {
                // deserialize byte [] to Command object
                Command deserializedCmd = (Command)SerializationHelper.deserialize(command);   
                rcm.processCommandFromRemoteConnection(deserializedCmd);
            }
        } catch (Exception e) {
            // Log the problem encountered during deserialization or rcm processing command
            Object[] args = { Helper.getShortClassName(command), Helper.printStackTraceToString(e) };
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.sessions.coordination.Command

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.