Top Description Fields Constructors Methods
org.glassfish.pfl.basic.reflection

public final Class Bridge

extends BridgeBase
Class Inheritance
Imports
java.io.OptionalDataException, java.lang.invoke.MethodHandle, java.lang.reflect.Constructor, java.security.Permission, sun.reflect.ReflectionFactory

This class provides the methods for fundamental JVM operations needed in the ORB that are not part of the public Java API. This includes: The code that calls Bridge.get() must have the following Permissions:

All of these permissions are required to obtain and correctly initialize the instance of Bridge. No security checks are performed on calls made to Bridge instance methods, so access to the Bridge instance must be protected.

This class is a singleton (per ClassLoader of course). Access to the instance is obtained through the Bridge.get() method.

Field Summary

Modifier and TypeField and Description
private static Bridge
private static final Permission
private final ReflectionFactory
Inherited from org.glassfish.pfl.basic.reflection.BridgeBase:
INVALID_FIELD_OFFSET

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static synchronized Bridge

Returns:

The singleton instance of the Bridge class
get
()

Fetch the Bridge singleton.

public boolean
hasStaticInitializerForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.hasStaticInitializerForSerialization.

Returns true if the given class defines a static initializer method, false otherwise.

public <T> Constructor<T>
newConstructorForExternalization(Class<T> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForExternalization.

Return a constructor that can be used to create an instance of the class for externalization.

public <T> Constructor<T>
newConstructorForSerialization(Class<T> aClass, Constructor<?> cons)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Return a no-arg constructor for the specified class which invokes the specified constructor.

public <T> Constructor<T>
newConstructorForSerialization(Class<T> aClass)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Return a no-arg constructor for the specified class, based on the default constructor for its nearest non-serializable base class.

public OptionalDataException
public MethodHandle
readObjectForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.readObjectForSerialization.

Returns a method handle to allow invocation of the specified class's readObject method.

public MethodHandle
public MethodHandle
readResolveForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.readResolveForSerialization.

Returns a method handle to allow invocation of the specified class's readResolve method.

public MethodHandle
writeObjectForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.writeObjectForSerialization.

Returns a method handle to allow invocation of the specified class's writeObject method.

public MethodHandle
writeReplaceForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.writeReplaceForSerialization.

Returns a method handle to allow invocation of the specified class's writeReplace method.

Inherited from org.glassfish.pfl.basic.reflection.BridgeBase:
defineClassensureClassInitializedgetBooleangetBytegetChargetDoublegetFloatgetIntgetLatestUserDefinedLoadergetLonggetObjectgetShortobjectFieldOffsetputBooleanputByteputCharputDoubleputFloatputIntputLongputObjectputShortstaticFieldOffsetthrowExceptiontoAccessibleFieldtoAccessibleMethod

Field Detail

bridgeback to summary
private static Bridge bridge
GET_BRIDGE_PERMISSIONback to summary
private static final Permission GET_BRIDGE_PERMISSION
reflectionFactoryback to summary
private final ReflectionFactory reflectionFactory

Constructor Detail

Bridgeback to summary
private Bridge()

Method Detail

getback to summary
public static synchronized Bridge get()

Fetch the Bridge singleton. This requires the following permissions:

  • RuntimePermission "reflectionFactoryAccess"
  • BridgePermission "getBridge"
  • ReflectPermission "suppressAccessChecks"
Returns:Bridge

The singleton instance of the Bridge class

Exceptions
SecurityException:
if the caller does not have the required permissions and the caller has a non-null security manager.
hasStaticInitializerForSerializationback to summary
public boolean hasStaticInitializerForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.hasStaticInitializerForSerialization.

Returns true if the given class defines a static initializer method, false otherwise.

Annotations
@Override
newConstructorForExternalizationback to summary
public <T> Constructor<T> newConstructorForExternalization(Class<T> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForExternalization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForExternalization.

Return a constructor that can be used to create an instance of the class for externalization.

Annotations
@Override
@SuppressWarnings:unchecked
newConstructorForSerializationback to summary
public <T> Constructor<T> newConstructorForSerialization(Class<T> aClass, Constructor<?> cons)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Return a no-arg constructor for the specified class which invokes the specified constructor.

Annotations
@Override
@SuppressWarnings:unchecked
newConstructorForSerializationback to summary
public <T> Constructor<T> newConstructorForSerialization(Class<T> aClass)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.newConstructorForSerialization.

Return a no-arg constructor for the specified class, based on the default constructor for its nearest non-serializable base class.

Annotations
@Override
@SuppressWarnings:unchecked
newOptionalDataExceptionForSerializationback to summary
public OptionalDataException newOptionalDataExceptionForSerialization(boolean bool)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.newOptionalDataExceptionForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.newOptionalDataExceptionForSerialization.

Return a new OptionalDataException instance.

Annotations
@Override
readObjectForSerializationback to summary
public MethodHandle readObjectForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.readObjectForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.readObjectForSerialization.

Returns a method handle to allow invocation of the specified class's readObject method.

Annotations
@Override
readObjectNoDataForSerializationback to summary
public MethodHandle readObjectNoDataForSerialization(Class<?> cl)
readResolveForSerializationback to summary
public MethodHandle readResolveForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.readResolveForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.readResolveForSerialization.

Returns a method handle to allow invocation of the specified class's readResolve method.

Annotations
@Override
writeObjectForSerializationback to summary
public MethodHandle writeObjectForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.writeObjectForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.writeObjectForSerialization.

Returns a method handle to allow invocation of the specified class's writeObject method.

Annotations
@Override
writeReplaceForSerializationback to summary
public MethodHandle writeReplaceForSerialization(Class<?> cl)

Implements abstract org.glassfish.pfl.basic.reflection.BridgeBase.writeReplaceForSerialization.

Doc from org.glassfish.pfl.basic.reflection.BridgeBase.writeReplaceForSerialization.

Returns a method handle to allow invocation of the specified class's writeReplace method.

Annotations
@Override