Class PICurrent
- java.lang.Object
-
- org.omg.CORBA.LocalObject
-
- com.sun.corba.ee.impl.interceptors.PICurrent
-
- All Implemented Interfaces:
java.io.Serializable
,Current
,CurrentOperations
,Object
,IDLEntity
,Current
,CurrentOperations
public class PICurrent extends LocalObject implements Current
PICurrent is the implementation of Current as specified in the Portable Interceptors Spec orbos/99-12-02. IMPORTANT: PICurrent is implemented with the assumption that get_slot() or set_slot() will not be called in ORBInitializer.pre_init() and post_init().- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ORB
myORB
private boolean
orbInitializing
private int
slotCounter
private java.lang.ThreadLocal<SlotTableStack>
threadLocalSlotTable
private static OMGSystemException
wrapper
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ORB
_orb()
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception with the message "This is a locally constrained object." This method is the default implementation of theorg.omg.CORBA.Object
method.(package private) int
allocateSlotId()
This method will be called from ORBInitInfo.allocate_slot_id( ).Any
get_slot(int id)
This method gets the slot data at the given slot id (index) from the Slot Table which is on the top of the SlotTableStack.(package private) SlotTable
getSlotTable()
This method gets the SlotTable which is on the top of the ThreadLocalStack.(package private) int
getTableSize()
(package private) void
popSlotTable()
This method pops a SlotTable on the SlotTableStack.(package private) void
pushSlotTable()
This method pushes a SlotTable on the SlotTableStack.(package private) void
resetSlotTable()
This method resets all the slot data to null in the Slot Table which is on the top of SlotTableStack.void
set_slot(int id, Any data)
This method sets the slot data at the given slot id (index) in the Slot Table which is on the top of the SlotTableStack.(package private) void
setORBInitializing(boolean init)
Called from ORB when the ORBInitializers are about to start initializing.-
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
-
-
-
Field Detail
-
wrapper
private static final OMGSystemException wrapper
-
slotCounter
private int slotCounter
-
myORB
private transient ORB myORB
-
orbInitializing
private boolean orbInitializing
-
threadLocalSlotTable
private transient java.lang.ThreadLocal<SlotTableStack> threadLocalSlotTable
-
-
Constructor Detail
-
PICurrent
PICurrent(ORB myORB)
PICurrent constructor which will be called for every ORB initialization.
-
-
Method Detail
-
_orb
public ORB _orb()
Description copied from class:LocalObject
Throws anorg.omg.CORBA.NO_IMPLEMENT
exception with the message "This is a locally constrained object." This method is the default implementation of theorg.omg.CORBA.Object
method.- Overrides:
_orb
in classLocalObject
- Returns:
- the ORB instance that created the Delegate contained in this
ObjectImpl
- See Also:
CORBA
package comments for unimplemented features
-
getTableSize
int getTableSize()
-
allocateSlotId
int allocateSlotId()
This method will be called from ORBInitInfo.allocate_slot_id( ). simply returns a slot id by incrementing slotCounter.
-
getSlotTable
SlotTable getSlotTable()
This method gets the SlotTable which is on the top of the ThreadLocalStack.
-
pushSlotTable
void pushSlotTable()
This method pushes a SlotTable on the SlotTableStack. When there is a resolve_initial_references("PICurrent") after this call. The new PICurrent will be returned.
-
popSlotTable
void popSlotTable()
This method pops a SlotTable on the SlotTableStack.
-
set_slot
public void set_slot(int id, Any data) throws InvalidSlot
This method sets the slot data at the given slot id (index) in the Slot Table which is on the top of the SlotTableStack.- Specified by:
set_slot
in interfaceCurrentOperations
- Parameters:
id
- TheSlotId
of the slot to which the data will be set.data
- The data, in the form of an Any, which will be set to the identified slot.- Throws:
InvalidSlot
- thrown ifset_slot
is called on a slot that has not been allocated.
-
get_slot
public Any get_slot(int id) throws InvalidSlot
This method gets the slot data at the given slot id (index) from the Slot Table which is on the top of the SlotTableStack.- Specified by:
get_slot
in interfaceCurrentOperations
- Parameters:
id
- TheSlotId
of the slot from which the data will be returned.- Returns:
- The data, in the form of an Any, of the given slot identifier.
- Throws:
InvalidSlot
- thrown if get_slot is called on a slot that has not been allocated.
-
resetSlotTable
void resetSlotTable()
This method resets all the slot data to null in the Slot Table which is on the top of SlotTableStack.
-
setORBInitializing
void setORBInitializing(boolean init)
Called from ORB when the ORBInitializers are about to start initializing.
-
-