Top Description Inners Fields Methods
org.hibernate.proxy

public Interface ProxyConfiguration

Imports
java.lang.reflect.Method, net.bytebuddy.implementation.bind.annotation.AllArguments, .FieldValue, .Origin, .RuntimeType, .StubValue, .This

A proxy configuration allows the definition of an interceptor object that decides on the behavior of a proxy. This interface is meant for internal use but is in a public package in order to provide code generation.

While this interface depends on Byte Buddy types, this is only true for annotation types which are silently suppressed by the runtime if they are not available on a class loader. This allows using this interceptor and configuration with for example OSGi without any export of Byte Buddy when using Hibernate.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ProxyConfiguration.Interceptor

An interceptor object that is responsible for invoking a proxy's method.

public static class
ProxyConfiguration.InterceptorDispatcher

A static interceptor that guards against method calls before the interceptor is set.

Field Summary

Modifier and TypeField and Description
public static final String
INTERCEPTOR_FIELD_NAME

The canonical field name for an interceptor object stored in a proxied object.

Method Summary

Modifier and TypeMethod and Description
public void
$$_hibernate_set_interceptor(ProxyConfiguration.Interceptor
The interceptor object.
interceptor
)

Defines an interceptor object that specifies the behavior of the proxy object.

Field Detail

INTERCEPTOR_FIELD_NAMEback to summary
public static final String INTERCEPTOR_FIELD_NAME

The canonical field name for an interceptor object stored in a proxied object.

Method Detail

$$_hibernate_set_interceptorback to summary
public void $$_hibernate_set_interceptor(ProxyConfiguration.Interceptor interceptor)

Defines an interceptor object that specifies the behavior of the proxy object.

Parameters
interceptor:ProxyConfiguration.Interceptor

The interceptor object.

org.hibernate.proxy back to summary

public Interface ProxyConfiguration.Interceptor

Known Direct Implementers
org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor, org.hibernate.bytecode.internal.bytebuddy.PassThroughInterceptor

An interceptor object that is responsible for invoking a proxy's method.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The method's return value.
intercept
(Object
The proxied instance.
instance
,
Method
The invoked method.
method
,
Object[]
The intercepted method arguments.
arguments
)

Intercepts a method call to a proxy.

Method Detail

interceptback to summary
public Object intercept(Object instance, Method method, Object[] arguments) throws Throwable

Intercepts a method call to a proxy.

Parameters
instance:Object

The proxied instance.

method:Method

The invoked method.

arguments:Object[]

The intercepted method arguments.

Returns:Object

The method's return value.

Annotations
@RuntimeType
Exceptions
Throwable:
If the intercepted method raises an exception.
org.hibernate.proxy back to summary

public Class ProxyConfiguration.InterceptorDispatcher

extends Object
Class Inheritance

A static interceptor that guards against method calls before the interceptor is set.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

The intercepted method's return value.
intercept
(final Object
The proxied instance.
instance
,
final Method
The invoked method.
method
,
final Object[]
The method arguments.
arguments
,
final Object
The intercepted method's default value.
stubValue
,
ProxyConfiguration.Interceptor
The proxy object's interceptor instance.
interceptor
)

Intercepts a method call to a proxy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

InterceptorDispatcherback to summary
public InterceptorDispatcher()

Method Detail

interceptback to summary
public static Object intercept(final Object instance, final Method method, final Object[] arguments, final Object stubValue, ProxyConfiguration.Interceptor interceptor) throws Throwable

Intercepts a method call to a proxy.

Parameters
instance:Object

The proxied instance.

method:Method

The invoked method.

arguments:Object[]

The method arguments.

stubValue:Object

The intercepted method's default value.

interceptor:ProxyConfiguration.Interceptor

The proxy object's interceptor instance.

Returns:Object

The intercepted method's return value.

Annotations
@RuntimeType
Exceptions
Throwable:
If the intercepted method raises an exception.