Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.moskito.controlagent.endpoints.rmi.generated.RemoteAgentServiceSkeleton Maven / Gradle / Ivy
package org.moskito.controlagent.endpoints.rmi.generated;
//BEGIN GENERATED CODE
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import org.distributeme.core.Verbosity;
import org.distributeme.core.Defaults;
import org.distributeme.core.ServerSideCallContext;
import org.distributeme.core.interceptor.ServerSideRequestInterceptor;
import org.distributeme.core.interceptor.InterceptorResponse;
import org.distributeme.core.interceptor.InterceptionContext;
import org.distributeme.core.interceptor.InterceptorRegistry;
import org.distributeme.core.interceptor.InterceptionPhase;
import org.distributeme.core.concurrencycontrol.ConcurrencyControlStrategy;
// Generated by org.distributeme.generator.SkeletonGenerator
@SuppressWarnings("PMD")
public class RemoteAgentServiceSkeleton implements RemoteAgentService {
private static Logger log = LoggerFactory.getLogger(RemoteAgentServiceSkeleton.class);
private org.moskito.controlagent.endpoints.rmi.AgentService implementation;
private long lastAccess;
private long created;
// CONCURRENCY CONTROL
// Class wide concurrency control strategy
private ConcurrencyControlStrategy clazzWideCCStrategy = Defaults.getDefaultConcurrencyControlStrategy();
private ConcurrencyControlStrategy getSystemInfoCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy getThresholdStatusCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy getThresholdsCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy getAvailableAccumulatorsCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy getAccumulatorsDataCCStrategy_javautilListaccumulatorNames = clazzWideCCStrategy;
private ConcurrencyControlStrategy getConfigCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy getNowRunningInfoCCStrategy = clazzWideCCStrategy;
// CONCURRENCY CONTROL end
public RemoteAgentServiceSkeleton(){
this(null);
}
public RemoteAgentServiceSkeleton(org.moskito.controlagent.endpoints.rmi.AgentService anImplementation){
created = System.currentTimeMillis();
implementation = anImplementation;
}
public List getSystemInfo(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getSystemInfo", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getSystemInfoCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getSystemInfo();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getSystemInfo()", e);
throw(e);
}finally{
getSystemInfoCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getThresholdStatus(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getThresholdStatus", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getThresholdStatusCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getThresholdStatus();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getThresholdStatus()", e);
throw(e);
}finally{
getThresholdStatusCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getThresholds(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getThresholds", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getThresholdsCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getThresholds();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getThresholds()", e);
throw(e);
}finally{
getThresholdsCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getAvailableAccumulators(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getAvailableAccumulators", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getAvailableAccumulatorsCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getAvailableAccumulators();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getAvailableAccumulators()", e);
throw(e);
}finally{
getAvailableAccumulatorsCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getAccumulatorsData(java.util.List accumulatorNames, Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getAccumulatorsData", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(accumulatorNames);
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getAccumulatorsDataCCStrategy_javautilListaccumulatorNames.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getAccumulatorsData(accumulatorNames);
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getAccumulatorsData()", e);
throw(e);
}finally{
getAccumulatorsDataCCStrategy_javautilListaccumulatorNames.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getConfig(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getConfig", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getConfigCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getConfig();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getConfig()", e);
throw(e);
}finally{
getConfigCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List getNowRunningInfo(Map,?> __transportableCallContext) throws org.moskito.controlagent.endpoints.rmi.AgentServiceException{
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("getNowRunningInfo", __transportableCallContext);
diMeCallContext.setServiceId(AgentServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeCallContext.setParameters(diMeParameters);
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getServerSideRequestInterceptors();
ArrayList __return = new ArrayList();
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.BEFORE_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.beforeServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
// Concurrency control, server side -
getNowRunningInfoCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.getNowRunningInfo();
__return.add(__result);
diMeInterceptionContext.setReturnValue(__result);
__return.add(diMeCallContext.getTransportableCallContext());
diMeInterceptionContext.setCurrentPhase(InterceptionPhase.AFTER_SERVANT_CALL);
for (ServerSideRequestInterceptor interceptor : diMeInterceptors){
InterceptorResponse interceptorResponse = interceptor.afterServantCall(diMeCallContext, diMeInterceptionContext);
switch(interceptorResponse.getCommand()){
case ABORT:
if (interceptorResponse.getException() instanceof RuntimeException)
throw (RuntimeException) interceptorResponse.getException();
if (interceptorResponse.getException() instanceof org.moskito.controlagent.endpoints.rmi.AgentServiceException)
throw (org.moskito.controlagent.endpoints.rmi.AgentServiceException) interceptorResponse.getException();
throw new RuntimeException("Interceptor exception",interceptorResponse.getException());
case RETURN:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case OVERWRITE_RETURN_AND_CONTINUE:
__return.set(0, interceptorResponse.getReturnValue());
diMeInterceptionContext.setReturnValue(interceptorResponse.getReturnValue());
break;
case CONTINUE:
break;
} //...switch
} //...for
return __return;
}catch(org.moskito.controlagent.endpoints.rmi.AgentServiceException e){
if (Verbosity.logServerSideExceptions())
log.error("getNowRunningInfo()", e);
throw(e);
}finally{
getNowRunningInfoCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
// Service adapter methods
public long getCreationTimestamp(){ return created; }
public long getLastAccessTimestamp(){ return lastAccess; }
}