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.distributeme.test.fail.generated.RemoteFailableServiceSkeleton Maven / Gradle / Ivy
package org.distributeme.test.fail.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;
import net.anotheria.moskito.core.dynamic.MoskitoInvokationProxy;
import net.anotheria.moskito.core.predefined.ServiceStatsCallHandler;
import net.anotheria.moskito.core.predefined.ServiceStatsFactory;
import net.anotheria.moskito.core.registry.IProducerRegistryAPI;
import net.anotheria.moskito.core.registry.ProducerRegistryAPIFactory;
import net.anotheria.moskito.core.producers.IStatsProducer;
import net.anotheria.moskito.core.logging.LoggerUtil;
// Generated by org.distributeme.generator.SkeletonGenerator
@SuppressWarnings("PMD")
public class RemoteFailableServiceSkeleton implements RemoteFailableService {
private static Logger log = LoggerFactory.getLogger(RemoteFailableServiceSkeleton.class);
private org.distributeme.test.fail.FailableService implementation;
private long lastAccess;
private long created;
// CONCURRENCY CONTROL
// Class wide concurrency control strategy
private ConcurrencyControlStrategy clazzWideCCStrategy = Defaults.getDefaultConcurrencyControlStrategy();
private ConcurrencyControlStrategy failableMethodCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy retryMethodCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy retryOnceMethodCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy defaultMethodCCStrategy = clazzWideCCStrategy;
private ConcurrencyControlStrategy failableEchoCCStrategy_longvalue = clazzWideCCStrategy;
private ConcurrencyControlStrategy retryEchoCCStrategy_longvalue = clazzWideCCStrategy;
private ConcurrencyControlStrategy retryOnceEchoCCStrategy_longvalue = clazzWideCCStrategy;
private ConcurrencyControlStrategy failoverEchoCCStrategy_longvalue = clazzWideCCStrategy;
private ConcurrencyControlStrategy failoverPrintCCStrategy_javalangStringmessage = clazzWideCCStrategy;
private ConcurrencyControlStrategy failoverPrintAndStayCCStrategy_javalangStringmessage = clazzWideCCStrategy;
private ConcurrencyControlStrategy failoverPrintAndStayFoTenSecondsCCStrategy_javalangStringmessage = clazzWideCCStrategy;
// CONCURRENCY CONTROL end
public RemoteFailableServiceSkeleton(){
this(null);
}
public RemoteFailableServiceSkeleton(org.distributeme.test.fail.FailableService anImplementation){
created = System.currentTimeMillis();
MoskitoInvokationProxy proxy = new MoskitoInvokationProxy(
anImplementation,
new ServiceStatsCallHandler(),
new ServiceStatsFactory(),
"FailableService",
"service",
"default",
org.distributeme.test.fail.FailableService.class, net.anotheria.anoprise.metafactory.Service.class
);
implementation = (org.distributeme.test.fail.FailableService) proxy.createProxy();
// add moskito logger
LoggerUtil.createSLF4JDefaultAndIntervalStatsLogger(proxy.getProducer());
//end moskito logger
// //ADD LOGGING FOR ALL BUILTIN PRODUCERS
IProducerRegistryAPI api = new ProducerRegistryAPIFactory().createProducerRegistryAPI();
List stats = api.getAllProducersBySubsystem("builtin");
for (IStatsProducer producer : stats){
LoggerUtil.createSLF4JDefaultAndIntervalStatsLogger(producer);
}
}
public List failableMethod(Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failableMethod", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.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();
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 -
failableMethodCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.failableMethod();
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
failableMethodCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List retryMethod(Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("retryMethod", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.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();
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 -
retryMethodCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.retryMethod();
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
retryMethodCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List retryOnceMethod(Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("retryOnceMethod", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.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();
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 -
retryOnceMethodCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.retryOnceMethod();
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
retryOnceMethodCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List defaultMethod(Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("defaultMethod", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.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();
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 -
defaultMethodCCStrategy.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.defaultMethod();
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
defaultMethodCCStrategy.notifyServerSideCallFinished(diMeCallContext);
}
}
public List failableEcho(long value, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failableEcho", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(value);
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();
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 -
failableEchoCCStrategy_longvalue.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.failableEcho(value);
__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();
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;
}finally{
failableEchoCCStrategy_longvalue.notifyServerSideCallFinished(diMeCallContext);
}
}
public List retryEcho(long value, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("retryEcho", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(value);
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();
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 -
retryEchoCCStrategy_longvalue.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.retryEcho(value);
__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();
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;
}finally{
retryEchoCCStrategy_longvalue.notifyServerSideCallFinished(diMeCallContext);
}
}
public List retryOnceEcho(long value, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("retryOnceEcho", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(value);
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();
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 -
retryOnceEchoCCStrategy_longvalue.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.retryOnceEcho(value);
__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();
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;
}finally{
retryOnceEchoCCStrategy_longvalue.notifyServerSideCallFinished(diMeCallContext);
}
}
public List failoverEcho(long value, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failoverEcho", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(value);
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();
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 -
failoverEchoCCStrategy_longvalue.notifyServerSideCallStarted(diMeCallContext);
try{
Object __result = implementation.failoverEcho(value);
__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();
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;
}finally{
failoverEchoCCStrategy_longvalue.notifyServerSideCallFinished(diMeCallContext);
}
}
public List failoverPrint(java.lang.String message, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failoverPrint", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(message);
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();
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 -
failoverPrintCCStrategy_javalangStringmessage.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.failoverPrint(message);
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
failoverPrintCCStrategy_javalangStringmessage.notifyServerSideCallFinished(diMeCallContext);
}
}
public List failoverPrintAndStay(java.lang.String message, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failoverPrintAndStay", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(message);
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();
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 -
failoverPrintAndStayCCStrategy_javalangStringmessage.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.failoverPrintAndStay(message);
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
failoverPrintAndStayCCStrategy_javalangStringmessage.notifyServerSideCallFinished(diMeCallContext);
}
}
public List failoverPrintAndStayFoTenSeconds(java.lang.String message, Map,?> __transportableCallContext){
lastAccess = System.currentTimeMillis();
ServerSideCallContext diMeCallContext = new ServerSideCallContext("failoverPrintAndStayFoTenSeconds", __transportableCallContext);
diMeCallContext.setServiceId(FailableServiceConstants.getServiceId());
ArrayList diMeParameters = new ArrayList();
diMeParameters.add(message);
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();
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 -
failoverPrintAndStayFoTenSecondsCCStrategy_javalangStringmessage.notifyServerSideCallStarted(diMeCallContext);
try{
implementation.failoverPrintAndStayFoTenSeconds(message);
__return.add(org.distributeme.core.util.VoidMarker.VOID);
__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();
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;
}finally{
failoverPrintAndStayFoTenSecondsCCStrategy_javalangStringmessage.notifyServerSideCallFinished(diMeCallContext);
}
}
// Service adapter methods
public long getCreationTimestamp(){ return created; }
public long getLastAccessTimestamp(){ return lastAccess; }
}