org.distributeme.test.inheritance.generated.RemoteBaseServiceStub Maven / Gradle / Ivy
package org.distributeme.test.inheritance.generated;
//BEGIN GENERATED CODE
import java.util.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import java.rmi.RemoteException;
import java.rmi.NotBoundException;
import org.distributeme.core.RegistryUtil;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import org.distributeme.core.ServiceDescriptor;
import org.distributeme.core.ServiceDescriptor.Protocol;
import org.distributeme.core.DiscoveryMode;
import org.distributeme.core.failing.FailingStrategy;
import org.distributeme.core.concurrencycontrol.ConcurrencyControlStrategy;
import org.distributeme.core.failing.FailDecision;
import org.distributeme.core.ClientSideCallContext;
import org.distributeme.core.exception.DistributemeRuntimeException;
import org.distributeme.core.exception.NoConnectionToServerException;
import org.distributeme.core.exception.ServiceUnavailableException;
import org.distributeme.core.Defaults;
import org.distributeme.core.interceptor.ClientSideRequestInterceptor;
import org.distributeme.core.interceptor.InterceptorRegistry;
import org.distributeme.core.interceptor.InterceptorResponse;
import org.distributeme.core.interceptor.InterceptionContext;
import org.distributeme.core.interceptor.InterceptionPhase;
import org.distributeme.core.interceptor.FailedByInterceptorException;
@SuppressWarnings("PMD")
public class RemoteBaseServiceStub implements org.distributeme.test.inheritance.BaseService{
private volatile ConcurrentMap delegates = new ConcurrentHashMap();
private DiscoveryMode discoveryMode = DiscoveryMode.AUTO;
// ROUTER DECL V2
// No class-wide-router set, skipping.
// Method wide routers if applicable
// Method wide routers END
// ROUTER DECL V2 end
// Failing
// Class wide failing strategy
private FailingStrategy clazzWideFailingStrategy = Defaults.getDefaultFailingStrategy();
private FailingStrategy echoFailingStrategy_longvalue = clazzWideFailingStrategy;
// Failing end
// CONCURRENCY CONTROL
// Class wide concurrency control strategy
private ConcurrencyControlStrategy clazzWideCCStrategy = Defaults.getDefaultConcurrencyControlStrategy();
private ConcurrencyControlStrategy echoCCStrategy_longvalue = clazzWideCCStrategy;
// CONCURRENCY CONTROL end
public RemoteBaseServiceStub(){
discoveryMode = DiscoveryMode.AUTO;
}
private ServiceDescriptor manuallySetDescriptor;
private RemoteBaseService manuallySetTarget;
public RemoteBaseServiceStub(ServiceDescriptor target){
discoveryMode = DiscoveryMode.MANUAL;
manuallySetDescriptor = target;
try{
manuallySetTarget = lookup(manuallySetDescriptor);
}catch(NoConnectionToServerException e){
throw new IllegalStateException("Can not resolve manually set reference", e);
}
}
public long echo(long value){
return echo(value, (ClientSideCallContext)null);
} //...public long echo(long value)
private long echo(long value, org.distributeme.core.ClientSideCallContext diMeCallContext){
List __fromServerSide = null;
Exception exceptionInMethod = null;
// This flag is used by the interceptor logic to mark a request es failed, even it is not.
boolean diMeForceFailing = false;
boolean abortAndFail = false;
if (diMeCallContext == null)
diMeCallContext = new ClientSideCallContext("echo");
if (discoveryMode == DiscoveryMode.MANUAL) {
diMeCallContext.setServiceId(manuallySetDescriptor.getServiceId());
}
if (discoveryMode==DiscoveryMode.AUTO && diMeCallContext.getServiceId()==null)
diMeCallContext.setServiceId(BaseServiceConstants.getServiceId());
HashMap __transportableCallContext = diMeCallContext.getTransportableCallContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getClientSideRequestInterceptors();
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Concurrency control, client side - start
echoCCStrategy_longvalue.notifyClientSideCallStarted(diMeCallContext);
try{
ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy