org.distributeme.test.blacklisting.generated.RemoteBlacklistingTestServiceStub Maven / Gradle / Ivy
package org.distributeme.test.blacklisting.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 RemoteBlacklistingTestServiceStub implements org.distributeme.test.blacklisting.BlacklistingTestService{
private volatile ConcurrentMap delegates = new ConcurrentHashMap();
private DiscoveryMode discoveryMode = DiscoveryMode.AUTO;
// ROUTER DECL V2
// Class wide router
private final org.distributeme.core.routing.Router clazzWideRouter = createRouterInstance6();
// Method wide routers if applicable
// Method wide routers END
// ROUTER DECL V2 end
// Failing
// Class wide failing strategy
private FailingStrategy clazzWideFailingStrategy = (FailingStrategy) clazzWideRouter;
private FailingStrategy doSomeThingFailingStrategy_intmod = clazzWideFailingStrategy;
// Failing end
// CONCURRENCY CONTROL
// Class wide concurrency control strategy
private ConcurrencyControlStrategy clazzWideCCStrategy = Defaults.getDefaultConcurrencyControlStrategy();
private ConcurrencyControlStrategy doSomeThingCCStrategy_intmod = clazzWideCCStrategy;
// CONCURRENCY CONTROL end
public RemoteBlacklistingTestServiceStub(){
discoveryMode = DiscoveryMode.AUTO;
}
private ServiceDescriptor manuallySetDescriptor;
private RemoteBlacklistingTestService manuallySetTarget;
public RemoteBlacklistingTestServiceStub(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 void doSomeThing(int mod){
doSomeThing(mod, (ClientSideCallContext)null);
} //...public void doSomeThing(int mod)
private void doSomeThing(int mod, 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("doSomeThing");
if (discoveryMode == DiscoveryMode.MANUAL) {
diMeCallContext.setServiceId(manuallySetDescriptor.getServiceId());
}
if (discoveryMode==DiscoveryMode.AUTO && diMeCallContext.getServiceId()==null)
diMeCallContext.setServiceId(BlacklistingTestServiceConstants.getServiceId());
HashMap __transportableCallContext = diMeCallContext.getTransportableCallContext();
// Initialize interceptors
List diMeInterceptors = InterceptorRegistry.getInstance().getClientSideRequestInterceptors();
InterceptionContext diMeInterceptionContext = new InterceptionContext();
// Concurrency control, client side - start
doSomeThingCCStrategy_intmod.notifyClientSideCallStarted(diMeCallContext);
try{
ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy