mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 11:47:38 +08:00
Add JavaDocs
This commit is contained in:
parent
8db1e5f599
commit
aba7b72a3d
@ -34,6 +34,12 @@ import java.lang.reflect.Parameter;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* Bean of the web block that creates a proxy object to invoke middleware services directly
|
||||
* using {@link LocalServiceInvoker}.
|
||||
*/
|
||||
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
|
||||
|
||||
private Object serviceProxy;
|
||||
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
|
||||
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
||||
|
||||
LocalServiceInvocationResult result = invoker.invoke(invocation);
|
||||
AppContext.setSecurityContext(AppContext.getSecurityContext());//need reset application name in LogMDC for the current thread
|
||||
AppContext.setSecurityContext(AppContext.getSecurityContext());// to reset application name in LogMDC for the current thread
|
||||
|
||||
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
|
||||
if (result.getException() != null) {
|
||||
|
@ -25,6 +25,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* This class holds a collection of {@link LocalServiceInvoker} instances. It must be loaded to a classloader shared
|
||||
* between the client tier and middleware.
|
||||
*/
|
||||
public class LocalServiceDirectory {
|
||||
|
||||
private static Map<String, LocalServiceInvoker> invokers = new ConcurrentHashMap<>();
|
||||
|
@ -20,6 +20,11 @@ package com.haulmont.cuba.core.sys.remoting;
|
||||
import java.util.TimeZone;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* An object that is passed when invoking middleware services using {@link LocalServiceInvoker}.
|
||||
*/
|
||||
public class LocalServiceInvocation {
|
||||
private String methodName;
|
||||
private String[] parameterTypeNames;
|
||||
|
@ -17,6 +17,11 @@
|
||||
|
||||
package com.haulmont.cuba.core.sys.remoting;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* A result object that is returned to the client when invoking middleware services using {@link LocalServiceInvoker}.
|
||||
*/
|
||||
public class LocalServiceInvocationResult {
|
||||
|
||||
private byte[] data;
|
||||
|
@ -17,6 +17,13 @@
|
||||
|
||||
package com.haulmont.cuba.core.sys.remoting;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* Enables direct invocation of middleware services from the client tier.
|
||||
* Implementation objects are created on the middleware side and registered in {@link LocalServiceDirectory},
|
||||
* which is available both to the client and middle tier.
|
||||
*/
|
||||
public interface LocalServiceInvoker {
|
||||
|
||||
LocalServiceInvocationResult invoke(LocalServiceInvocation invocation);
|
||||
|
@ -34,6 +34,12 @@ import java.lang.reflect.Parameter;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* INTERNAL.
|
||||
* <p>
|
||||
* Bean of the web block that creates a proxy object to invoke middleware services directly
|
||||
* using {@link LocalServiceInvoker}.
|
||||
*/
|
||||
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
|
||||
|
||||
private Object serviceProxy;
|
||||
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
|
||||
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
||||
|
||||
LocalServiceInvocationResult result = invoker.invoke(invocation);
|
||||
AppContext.setSecurityContext(AppContext.getSecurityContext());//need reset application name in LogMDC for the current thread
|
||||
AppContext.setSecurityContext(AppContext.getSecurityContext()); // to reset application name in LogMDC for the current thread
|
||||
|
||||
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
|
||||
if (result.getException() != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user