mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +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.lang.reflect.Proxy;
|
||||||
import java.util.UUID;
|
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 {
|
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
|
||||||
|
|
||||||
private Object serviceProxy;
|
private Object serviceProxy;
|
||||||
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
|
|||||||
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
||||||
|
|
||||||
LocalServiceInvocationResult result = invoker.invoke(invocation);
|
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
|
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
|
||||||
if (result.getException() != null) {
|
if (result.getException() != null) {
|
||||||
|
@ -25,6 +25,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
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 {
|
public class LocalServiceDirectory {
|
||||||
|
|
||||||
private static Map<String, LocalServiceInvoker> invokers = new ConcurrentHashMap<>();
|
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.TimeZone;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* INTERNAL.
|
||||||
|
* <p>
|
||||||
|
* An object that is passed when invoking middleware services using {@link LocalServiceInvoker}.
|
||||||
|
*/
|
||||||
public class LocalServiceInvocation {
|
public class LocalServiceInvocation {
|
||||||
private String methodName;
|
private String methodName;
|
||||||
private String[] parameterTypeNames;
|
private String[] parameterTypeNames;
|
||||||
|
@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
package com.haulmont.cuba.core.sys.remoting;
|
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 {
|
public class LocalServiceInvocationResult {
|
||||||
|
|
||||||
private byte[] data;
|
private byte[] data;
|
||||||
|
@ -17,6 +17,13 @@
|
|||||||
|
|
||||||
package com.haulmont.cuba.core.sys.remoting;
|
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 {
|
public interface LocalServiceInvoker {
|
||||||
|
|
||||||
LocalServiceInvocationResult invoke(LocalServiceInvocation invocation);
|
LocalServiceInvocationResult invoke(LocalServiceInvocation invocation);
|
||||||
|
@ -34,6 +34,12 @@ import java.lang.reflect.Parameter;
|
|||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.util.UUID;
|
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 {
|
public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Object>, InitializingBean {
|
||||||
|
|
||||||
private Object serviceProxy;
|
private Object serviceProxy;
|
||||||
@ -146,7 +152,7 @@ public class LocalServiceProxy extends RemoteAccessor implements FactoryBean<Obj
|
|||||||
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
invocation.setResultBypassSerialization(canMethodResultBypassSerialization(method));
|
||||||
|
|
||||||
LocalServiceInvocationResult result = invoker.invoke(invocation);
|
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
|
// don't use SerializationUtils.deserialize() here to avoid ClassNotFoundException
|
||||||
if (result.getException() != null) {
|
if (result.getException() != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user