@Test public void createCommandResolver_NoTimeout() throws IOException { CommandResolver<SocketTransportCommand> cr = createCommandResolver(DefaultTimeConstraints.NO_CONSTRAINTS, tracer); Iterable<ExecutionCommand> executionCommands = cr.resolveExecutionCommands(); ExecutionCommand executionCommand = executionCommands.iterator().next(); TimeConstraints constraints = executionCommand.getTimeConstraints(); assertNull(constraints.getExpiryTime()); }
@Override protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command, final Tracer tracer) { try { final CougarObjectInput in = command.getInput(); if (command instanceof SocketTransportRPCCommand) { final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command; X509Certificate[] clientCertChain = (X509Certificate[]) rpcCommand.getSession().getAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME); Integer transportSecurityStrengthFactor = (Integer) rpcCommand.getSession().getAttribute(CougarProtocol.TSSF_ATTR_NAME); Object sslSession = rpcCommand.getSession().getAttribute(SSLFilter.SSL_SESSION); if (sslSession != null) { if (clientCertChain == null) { SSLSession session = (SSLSession) sslSession; try { clientCertChain = X509CertificateUtils.convert(session.getPeerCertificateChain()); } catch (SSLPeerUnverifiedException spue) { LOGGER.debug("SSL peer unverified"); clientCertChain = new X509Certificate[0]; } rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { SSLSession session = (SSLSession) sslSession; transportSecurityStrengthFactor = SSLCipherUtils.deduceKeyLength(session.getCipherSuite(), unknownCipherKeyLength); rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } else { if (clientCertChain == null) { clientCertChain = new X509Certificate[0]; rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { transportSecurityStrengthFactor = 0; rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession()); final DehydratedExecutionContext context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion); final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context); OperationKey remoteOperationKey = marshaller.readOperationKey(in); OperationDefinition opDef = findCompatibleBinding(remoteOperationKey); if (opDef == null) { throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'"); } final OperationKey operationKey = opDef.getOperationKey(); final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey); final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in); TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion); final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints); final ExecutionCommand exec = new ExecutionCommand() { @Override public Object[] getArgs() { return args; } @Override public OperationKey getOperationKey() { return operationKey; } @Override public void onResult(ExecutionResult result) { if (result.getResultType() == ExecutionResult.ResultType.Success) { if (operationKey.getType() == OperationKey.Type.ConnectedObject) { connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension()); } else { writeSuccessResponse(rpcCommand, result, requestContext); } } else if (result.getResultType() == ExecutionResult.ResultType.Fault) { writeErrorResponse(rpcCommand, requestContext, result.getFault(), true); } } @Override public TimeConstraints getTimeConstraints() { return timeConstraints; } }; return new SingleExecutionCommandResolver<SocketTransportCommand>(tracer) { @Override public ExecutionCommand resolveExecutionCommand(Tracer tracer) { return exec; } @Override public DehydratedExecutionContext resolveExecutionContext() { return requestContext; } }; } else { LOGGER.error("SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); nioLogger.log(NioLogger.LoggingLevel.SESSION, command.getSession(), "SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); command.getSession().close(); throw new IllegalStateException("Received an event request for processing like an rpc request"); } } catch (EnumDerialisationException ede) { final String message = ede.getMessage(); LOGGER.debug(message, ede); throw CougarMarshallingException.unmarshallingException("binary",message,ede,false); } catch (CougarException ce) { throw ce; } catch (TranscriptionException e) { final String message = "transcription exception deserialising invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } catch (Exception e) { final String message = "Unable to deserialise invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } }
SocketTransportCommandProcessor extends AbstractCommandProcessor<SocketTransportCommand> implements GateListener { @Override protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command, final Tracer tracer) { try { final CougarObjectInput in = command.getInput(); if (command instanceof SocketTransportRPCCommand) { final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command; X509Certificate[] clientCertChain = (X509Certificate[]) rpcCommand.getSession().getAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME); Integer transportSecurityStrengthFactor = (Integer) rpcCommand.getSession().getAttribute(CougarProtocol.TSSF_ATTR_NAME); Object sslSession = rpcCommand.getSession().getAttribute(SSLFilter.SSL_SESSION); if (sslSession != null) { if (clientCertChain == null) { SSLSession session = (SSLSession) sslSession; try { clientCertChain = X509CertificateUtils.convert(session.getPeerCertificateChain()); } catch (SSLPeerUnverifiedException spue) { LOGGER.debug("SSL peer unverified"); clientCertChain = new X509Certificate[0]; } rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { SSLSession session = (SSLSession) sslSession; transportSecurityStrengthFactor = SSLCipherUtils.deduceKeyLength(session.getCipherSuite(), unknownCipherKeyLength); rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } else { if (clientCertChain == null) { clientCertChain = new X509Certificate[0]; rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { transportSecurityStrengthFactor = 0; rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession()); final DehydratedExecutionContext context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion); final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context); OperationKey remoteOperationKey = marshaller.readOperationKey(in); OperationDefinition opDef = findCompatibleBinding(remoteOperationKey); if (opDef == null) { throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'"); } final OperationKey operationKey = opDef.getOperationKey(); final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey); final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in); TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion); final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints); final ExecutionCommand exec = new ExecutionCommand() { @Override public Object[] getArgs() { return args; } @Override public OperationKey getOperationKey() { return operationKey; } @Override public void onResult(ExecutionResult result) { if (result.getResultType() == ExecutionResult.ResultType.Success) { if (operationKey.getType() == OperationKey.Type.ConnectedObject) { connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension()); } else { writeSuccessResponse(rpcCommand, result, requestContext); } } else if (result.getResultType() == ExecutionResult.ResultType.Fault) { writeErrorResponse(rpcCommand, requestContext, result.getFault(), true); } } @Override public TimeConstraints getTimeConstraints() { return timeConstraints; } }; return new SingleExecutionCommandResolver<SocketTransportCommand>(tracer) { @Override public ExecutionCommand resolveExecutionCommand(Tracer tracer) { return exec; } @Override public DehydratedExecutionContext resolveExecutionContext() { return requestContext; } }; } else { LOGGER.error("SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); nioLogger.log(NioLogger.LoggingLevel.SESSION, command.getSession(), "SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); command.getSession().close(); throw new IllegalStateException("Received an event request for processing like an rpc request"); } } catch (EnumDerialisationException ede) { final String message = ede.getMessage(); LOGGER.debug(message, ede); throw CougarMarshallingException.unmarshallingException("binary",message,ede,false); } catch (CougarException ce) { throw ce; } catch (TranscriptionException e) { final String message = "transcription exception deserialising invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } catch (Exception e) { final String message = "Unable to deserialise invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } } }
SocketTransportCommandProcessor extends AbstractCommandProcessor<SocketTransportCommand> implements GateListener { @Override protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command, final Tracer tracer) { try { final CougarObjectInput in = command.getInput(); if (command instanceof SocketTransportRPCCommand) { final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command; X509Certificate[] clientCertChain = (X509Certificate[]) rpcCommand.getSession().getAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME); Integer transportSecurityStrengthFactor = (Integer) rpcCommand.getSession().getAttribute(CougarProtocol.TSSF_ATTR_NAME); Object sslSession = rpcCommand.getSession().getAttribute(SSLFilter.SSL_SESSION); if (sslSession != null) { if (clientCertChain == null) { SSLSession session = (SSLSession) sslSession; try { clientCertChain = X509CertificateUtils.convert(session.getPeerCertificateChain()); } catch (SSLPeerUnverifiedException spue) { LOGGER.debug("SSL peer unverified"); clientCertChain = new X509Certificate[0]; } rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { SSLSession session = (SSLSession) sslSession; transportSecurityStrengthFactor = SSLCipherUtils.deduceKeyLength(session.getCipherSuite(), unknownCipherKeyLength); rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } else { if (clientCertChain == null) { clientCertChain = new X509Certificate[0]; rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { transportSecurityStrengthFactor = 0; rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession()); final DehydratedExecutionContext context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion); final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context); OperationKey remoteOperationKey = marshaller.readOperationKey(in); OperationDefinition opDef = findCompatibleBinding(remoteOperationKey); if (opDef == null) { throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'"); } final OperationKey operationKey = opDef.getOperationKey(); final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey); final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in); TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion); final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints); final ExecutionCommand exec = new ExecutionCommand() { @Override public Object[] getArgs() { return args; } @Override public OperationKey getOperationKey() { return operationKey; } @Override public void onResult(ExecutionResult result) { if (result.getResultType() == ExecutionResult.ResultType.Success) { if (operationKey.getType() == OperationKey.Type.ConnectedObject) { connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension()); } else { writeSuccessResponse(rpcCommand, result, requestContext); } } else if (result.getResultType() == ExecutionResult.ResultType.Fault) { writeErrorResponse(rpcCommand, requestContext, result.getFault(), true); } } @Override public TimeConstraints getTimeConstraints() { return timeConstraints; } }; return new SingleExecutionCommandResolver<SocketTransportCommand>(tracer) { @Override public ExecutionCommand resolveExecutionCommand(Tracer tracer) { return exec; } @Override public DehydratedExecutionContext resolveExecutionContext() { return requestContext; } }; } else { LOGGER.error("SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); nioLogger.log(NioLogger.LoggingLevel.SESSION, command.getSession(), "SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); command.getSession().close(); throw new IllegalStateException("Received an event request for processing like an rpc request"); } } catch (EnumDerialisationException ede) { final String message = ede.getMessage(); LOGGER.debug(message, ede); throw CougarMarshallingException.unmarshallingException("binary",message,ede,false); } catch (CougarException ce) { throw ce; } catch (TranscriptionException e) { final String message = "transcription exception deserialising invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } catch (Exception e) { final String message = "Unable to deserialise invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } }  }
SocketTransportCommandProcessor extends AbstractCommandProcessor<SocketTransportCommand> implements GateListener { @Override protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command, final Tracer tracer) { try { final CougarObjectInput in = command.getInput(); if (command instanceof SocketTransportRPCCommand) { final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command; X509Certificate[] clientCertChain = (X509Certificate[]) rpcCommand.getSession().getAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME); Integer transportSecurityStrengthFactor = (Integer) rpcCommand.getSession().getAttribute(CougarProtocol.TSSF_ATTR_NAME); Object sslSession = rpcCommand.getSession().getAttribute(SSLFilter.SSL_SESSION); if (sslSession != null) { if (clientCertChain == null) { SSLSession session = (SSLSession) sslSession; try { clientCertChain = X509CertificateUtils.convert(session.getPeerCertificateChain()); } catch (SSLPeerUnverifiedException spue) { LOGGER.debug("SSL peer unverified"); clientCertChain = new X509Certificate[0]; } rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { SSLSession session = (SSLSession) sslSession; transportSecurityStrengthFactor = SSLCipherUtils.deduceKeyLength(session.getCipherSuite(), unknownCipherKeyLength); rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } else { if (clientCertChain == null) { clientCertChain = new X509Certificate[0]; rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { transportSecurityStrengthFactor = 0; rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession()); final DehydratedExecutionContext context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion); final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context); OperationKey remoteOperationKey = marshaller.readOperationKey(in); OperationDefinition opDef = findCompatibleBinding(remoteOperationKey); if (opDef == null) { throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'"); } final OperationKey operationKey = opDef.getOperationKey(); final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey); final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in); TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion); final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints); final ExecutionCommand exec = new ExecutionCommand() { @Override public Object[] getArgs() { return args; } @Override public OperationKey getOperationKey() { return operationKey; } @Override public void onResult(ExecutionResult result) { if (result.getResultType() == ExecutionResult.ResultType.Success) { if (operationKey.getType() == OperationKey.Type.ConnectedObject) { connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension()); } else { writeSuccessResponse(rpcCommand, result, requestContext); } } else if (result.getResultType() == ExecutionResult.ResultType.Fault) { writeErrorResponse(rpcCommand, requestContext, result.getFault(), true); } } @Override public TimeConstraints getTimeConstraints() { return timeConstraints; } }; return new SingleExecutionCommandResolver<SocketTransportCommand>(tracer) { @Override public ExecutionCommand resolveExecutionCommand(Tracer tracer) { return exec; } @Override public DehydratedExecutionContext resolveExecutionContext() { return requestContext; } }; } else { LOGGER.error("SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); nioLogger.log(NioLogger.LoggingLevel.SESSION, command.getSession(), "SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); command.getSession().close(); throw new IllegalStateException("Received an event request for processing like an rpc request"); } } catch (EnumDerialisationException ede) { final String message = ede.getMessage(); LOGGER.debug(message, ede); throw CougarMarshallingException.unmarshallingException("binary",message,ede,false); } catch (CougarException ce) { throw ce; } catch (TranscriptionException e) { final String message = "transcription exception deserialising invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } catch (Exception e) { final String message = "Unable to deserialise invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } }  void setStartingGate(CougarStartingGate startingGate); @Override String getName(); @Override void process(SocketTransportCommand command); @Override void onCougarStart(); void bindOperation(OperationBindingDescriptor bindingDescriptor); @Override void bind(ServiceBindingDescriptor bindingDescriptor); @Required void setMarshaller(RemotableMethodInvocationMarshaller marshaller); RemotableMethodInvocationMarshaller getMarshaller(); EventLoggingRegistry getRegistry(); IdentityResolverFactory getIdentityResolverFactory(); void setIdentityResolverFactory(IdentityResolverFactory identityResolverFactory); @Required void setRegistry(EventLoggingRegistry registry); void setConnectedObjectManager(ServerConnectedObjectManager connectedObjectManager); @Override @ManagedAttribute int getPriority(); void setPriority(int priority); void setNioLogger(NioLogger nioLogger); @ManagedAttribute long getOutstandingRequests(); void setUnknownCipherKeyLength(int unknownCipherKeyLength); @ManagedAttribute int getUnknownCipherKeyLength(); }
SocketTransportCommandProcessor extends AbstractCommandProcessor<SocketTransportCommand> implements GateListener { @Override protected CommandResolver<SocketTransportCommand> createCommandResolver(SocketTransportCommand command, final Tracer tracer) { try { final CougarObjectInput in = command.getInput(); if (command instanceof SocketTransportRPCCommand) { final SocketTransportRPCCommand rpcCommand = (SocketTransportRPCCommand) command; X509Certificate[] clientCertChain = (X509Certificate[]) rpcCommand.getSession().getAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME); Integer transportSecurityStrengthFactor = (Integer) rpcCommand.getSession().getAttribute(CougarProtocol.TSSF_ATTR_NAME); Object sslSession = rpcCommand.getSession().getAttribute(SSLFilter.SSL_SESSION); if (sslSession != null) { if (clientCertChain == null) { SSLSession session = (SSLSession) sslSession; try { clientCertChain = X509CertificateUtils.convert(session.getPeerCertificateChain()); } catch (SSLPeerUnverifiedException spue) { LOGGER.debug("SSL peer unverified"); clientCertChain = new X509Certificate[0]; } rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { SSLSession session = (SSLSession) sslSession; transportSecurityStrengthFactor = SSLCipherUtils.deduceKeyLength(session.getCipherSuite(), unknownCipherKeyLength); rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } else { if (clientCertChain == null) { clientCertChain = new X509Certificate[0]; rpcCommand.getSession().setAttribute(CougarProtocol.CLIENT_CERTS_ATTR_NAME, clientCertChain); } if (transportSecurityStrengthFactor == null) { transportSecurityStrengthFactor = 0; rpcCommand.getSession().setAttribute(CougarProtocol.TSSF_ATTR_NAME, transportSecurityStrengthFactor); } } byte protocolVersion = CougarProtocol.getProtocolVersion(command.getSession()); final DehydratedExecutionContext context = marshaller.readExecutionContext(in, command.getRemoteAddress(), clientCertChain, transportSecurityStrengthFactor, protocolVersion); final SocketRequestContextImpl requestContext = new SocketRequestContextImpl(context); OperationKey remoteOperationKey = marshaller.readOperationKey(in); OperationDefinition opDef = findCompatibleBinding(remoteOperationKey); if (opDef == null) { throw new CougarFrameworkException("Can't find operation definition in bindings for operation named '" + remoteOperationKey.getOperationName() + "'"); } final OperationKey operationKey = opDef.getOperationKey(); final OperationDefinition operationDefinition = getExecutionVenue().getOperationDefinition(operationKey); final Object[] args = marshaller.readArgs(operationDefinition.getParameters(), in); TimeConstraints rawTimeConstraints = marshaller.readTimeConstraintsIfPresent(in, protocolVersion); final TimeConstraints timeConstraints = DefaultTimeConstraints.rebaseFromNewStartTime(context.getRequestTime(), rawTimeConstraints); final ExecutionCommand exec = new ExecutionCommand() { @Override public Object[] getArgs() { return args; } @Override public OperationKey getOperationKey() { return operationKey; } @Override public void onResult(ExecutionResult result) { if (result.getResultType() == ExecutionResult.ResultType.Success) { if (operationKey.getType() == OperationKey.Type.ConnectedObject) { connectedObjectManager.addSubscription(SocketTransportCommandProcessor.this, rpcCommand, (ConnectedResponse) result.getResult(), operationDefinition, requestContext, requestContext.getConnectedObjectLogExtension()); } else { writeSuccessResponse(rpcCommand, result, requestContext); } } else if (result.getResultType() == ExecutionResult.ResultType.Fault) { writeErrorResponse(rpcCommand, requestContext, result.getFault(), true); } } @Override public TimeConstraints getTimeConstraints() { return timeConstraints; } }; return new SingleExecutionCommandResolver<SocketTransportCommand>(tracer) { @Override public ExecutionCommand resolveExecutionCommand(Tracer tracer) { return exec; } @Override public DehydratedExecutionContext resolveExecutionContext() { return requestContext; } }; } else { LOGGER.error("SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); nioLogger.log(NioLogger.LoggingLevel.SESSION, command.getSession(), "SocketTransportCommandProcessor - Received an event request for processing like an rpc request, closing session"); command.getSession().close(); throw new IllegalStateException("Received an event request for processing like an rpc request"); } } catch (EnumDerialisationException ede) { final String message = ede.getMessage(); LOGGER.debug(message, ede); throw CougarMarshallingException.unmarshallingException("binary",message,ede,false); } catch (CougarException ce) { throw ce; } catch (TranscriptionException e) { final String message = "transcription exception deserialising invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } catch (Exception e) { final String message = "Unable to deserialise invocation"; LOGGER.debug(message, e); throw CougarMarshallingException.unmarshallingException("binary",message,e,false); } }  void setStartingGate(CougarStartingGate startingGate); @Override String getName(); @Override void process(SocketTransportCommand command); @Override void onCougarStart(); void bindOperation(OperationBindingDescriptor bindingDescriptor); @Override void bind(ServiceBindingDescriptor bindingDescriptor); @Required void setMarshaller(RemotableMethodInvocationMarshaller marshaller); RemotableMethodInvocationMarshaller getMarshaller(); EventLoggingRegistry getRegistry(); IdentityResolverFactory getIdentityResolverFactory(); void setIdentityResolverFactory(IdentityResolverFactory identityResolverFactory); @Required void setRegistry(EventLoggingRegistry registry); void setConnectedObjectManager(ServerConnectedObjectManager connectedObjectManager); @Override @ManagedAttribute int getPriority(); void setPriority(int priority); void setNioLogger(NioLogger nioLogger); @ManagedAttribute long getOutstandingRequests(); void setUnknownCipherKeyLength(int unknownCipherKeyLength); @ManagedAttribute int getUnknownCipherKeyLength();  }