Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.remote.ejb
Class EJBConnection

java.lang.Object
  extended byoracle.toplink.internal.remote.RemoteConnection
      extended byoracle.toplink.remote.ejb.EJBConnection

All Implemented Interfaces:
java.io.Serializable

public class EJBConnection
extends oracle.toplink.internal.remote.RemoteConnection

This class exists on on the client side which talks to remote session controller through RMI connection.

See Also:
Serialized Form

Constructor Summary
EJBConnection(RemoteSessionController controller)
PUBLIC: The connection must be create from the server-side session controllers stub.

Method Summary
void addRemoteControllerForSynchronization(java.lang.Object remoteDispatcher)
Deprecated. Since 4.0
void beginTransaction()
PUBLIC: Begin a transaction on the database.
void commitTransaction()
PUBLIC: Commit a transaction on the database.
boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject)
TESTING: Return if the two object match completely.
boolean compareObjectsDontMatch(java.lang.Object firstObject, java.lang.Object secondObject)
TESTING: Return true if the object do not match.
boolean containsObjectInIdentityMap(java.lang.Object domainObject)
ADVANCED: Return if an object is in the identity map
boolean containsObjectInIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)
ADVANCED: Return if an insatnce of class with known primary key is in the identity map
Session createProxySession()
PUBLIC: Returns a proxy session.
Session createRemoteSession()
PUBLIC: Returns a remote session.
void cursoredStreamClose(java.rmi.server.ObjID remoteCursoredStreamOid)
PUBLIC: Close cursored stream across RMI.
java.util.Vector cursoredStreamNextPage(oracle.toplink.internal.remote.RemoteCursoredStream remoteCursoredStream, ReadQuery query, RemoteSession session, int pageSize)
PUBLIC: Retrieve next page size of objects from the cursored stream.
int cursoredStreamSize(java.rmi.server.ObjID remoteCursoredStreamID)
PUBLIC: Return the cursored stream size.
Descriptor getDescriptor(java.lang.Class domainClass)
PUBLIC: Extract descriptor from the session
ExceptionHandler getExceptionHandler()
PUBLIC: Return the ExceptionHandler.
java.lang.Object getFromIdentityMap(java.lang.Object domainObject)
ADVANCED: Return the object from the identity with primary and class of the given object.
java.lang.Object getFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)
ADVANCED: Return the object from the identity with the primary and class.
java.io.Writer getLog()
PUBLIC: Return the writer to which an accessor writes logged messages and SQL.
SessionProfiler getProfiler()
PUBLIC: Return the profiler.
SessionLog getSessionLog()
PUBLIC: Return the session log to which an accessor logs messages and SQL.
void initializeIdentityMap(java.lang.Class theClass)
PUBLIC: Reset the identity map for only the instances of the class.
void initializeIdentityMapsOnServerSession()
PUBLIC: Reset the identity map for only the instances of the class on the server-side session.
void log(SessionLogEntry entry)
PUBLIC: Log the log entry.
void printIdentityMap(java.lang.Class theClass)
PUBLIC: Print all instances of the specified class in the identity map.
void printIdentityMaps()
PUBLIC: Print all the objects in every identity map in this session.
void processCommand(oracle.toplink.internal.remote.RemoteCommand command)
ADVANCED: This method will send the command to the remote session for processing
void removeFromIdentityMap(java.lang.Object domainObject)
ADVANCED: Remove the object from the object cache.
void removeFromIdentityMap(java.util.Vector key, java.lang.Class theClass)
ADVANCED: Remove the object from the object cache.
void rollbackTransaction()
PUBLIC: Rollback a transaction on the database.
boolean scrollableCursorAbsolute(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)
PUBLIC: Move the cursor to the given row number in the result set.
void scrollableCursorAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the end of the result set, just after the last row.
void scrollableCursorBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the front of the result set, just before the first row.
void scrollableCursorClose(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Close the scrollable cursor across RMI.
int scrollableCursorCurrentIndex(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Retrieve the current row index number.
boolean scrollableCursorFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the first row in the result set.
boolean scrollableCursorIsAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is after the last row in the result set.
boolean scrollableCursorIsBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is before the first row in the result set.
boolean scrollableCursorIsFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is on the first row of the result set.
boolean scrollableCursorIsLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is on the last row of the result set.
boolean scrollableCursorLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the last row in the result set
java.lang.Object scrollableCursorNextObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, RemoteSession session)
PUBLIC: Retrieve next object from the scrollable cursor.
java.lang.Object scrollableCursorPreviousObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, RemoteSession session)
PUBLIC: Retrieve previous object from the scrollable cursor.
boolean scrollableCursorRelative(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)
PUBLIC: Move the cursor to the given row number in the result set.
int scrollableCursorSize(java.rmi.server.ObjID cursorId)
PUBLIC: Return the cursor size.
void setExceptionHandler(ExceptionHandler exceptionHandler)
PUBLIC: Set the exceptionHandler.
void setLog(java.io.Writer log)
PUBLIC: Set the writer to which an accessor writes logged messages and SQL.
void setLogin(DatabaseLogin login)
PUBLIC: Set the login.
void setProfiler(SessionProfiler profiler)
PUBLIC: Set the profiler for the session.
void setSessionLog(SessionLog sessionLog)
PUBLIC: Set the session log to which an accessor logs messages and SQL.
void setShouldLogMessages(boolean shouldLogMessages)
PUBLIC: Set messages logging.
boolean shouldLogMessages()
PUBLIC: Return if all messages such as executed SQL commands should be logged.
void validateCache()
ADVANCED: This can be used to help debugging an object identity problem.

Methods inherited from class oracle.toplink.internal.remote.RemoteConnection
getServiceName, setServiceName

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

EJBConnection

public EJBConnection(RemoteSessionController controller)
PUBLIC: The connection must be create from the server-side session controllers stub. The session in then created from the connection through createRemoteSession().
See Also:
#createRemoteSession();

Method Detail

addRemoteControllerForSynchronization

public void addRemoteControllerForSynchronization(java.lang.Object remoteDispatcher)
                                           throws java.lang.Exception
Deprecated. Since 4.0
ADVANCED: This method is intended to be used by newly connecting nodes to notify the other nodes in a distributed system to send changes to this calling server
Throws:
java.lang.Exception

processCommand

public void processCommand(oracle.toplink.internal.remote.RemoteCommand command)
ADVANCED: This method will send the command to the remote session for processing
Parameters:
command - RemoteCOmmand Contains a command that will be executed on the remote session
See Also:
oracle.toplink.internal.RemoteCommand

beginTransaction

public void beginTransaction()
PUBLIC: Begin a transaction on the database.

commitTransaction

public void commitTransaction()
PUBLIC: Commit a transaction on the database.

compareObjects

public boolean compareObjects(java.lang.Object firstObject,
                              java.lang.Object secondObject)
TESTING: Return if the two object match completely. This checks the objects attributes and their private parts.

compareObjectsDontMatch

public boolean compareObjectsDontMatch(java.lang.Object firstObject,
                                       java.lang.Object secondObject)
TESTING: Return true if the object do not match. This checks the objects attributes and their private parts.

containsObjectInIdentityMap

public boolean containsObjectInIdentityMap(java.lang.Object domainObject)
ADVANCED: Return if an object is in the identity map

containsObjectInIdentityMap

public boolean containsObjectInIdentityMap(java.util.Vector primaryKey,
                                           java.lang.Class theClass)
ADVANCED: Return if an insatnce of class with known primary key is in the identity map

createProxySession

public Session createProxySession()
PUBLIC: Returns a proxy session.

createRemoteSession

public Session createRemoteSession()
PUBLIC: Returns a remote session.

cursoredStreamClose

public void cursoredStreamClose(java.rmi.server.ObjID remoteCursoredStreamOid)
PUBLIC: Close cursored stream across RMI.

cursoredStreamNextPage

public java.util.Vector cursoredStreamNextPage(oracle.toplink.internal.remote.RemoteCursoredStream remoteCursoredStream,
                                               ReadQuery query,
                                               RemoteSession session,
                                               int pageSize)
PUBLIC: Retrieve next page size of objects from the cursored stream.

cursoredStreamSize

public int cursoredStreamSize(java.rmi.server.ObjID remoteCursoredStreamID)
PUBLIC: Return the cursored stream size.

getDescriptor

public Descriptor getDescriptor(java.lang.Class domainClass)
PUBLIC: Extract descriptor from the session

getExceptionHandler

public ExceptionHandler getExceptionHandler()
PUBLIC: Return the ExceptionHandler. The exception handler can catch errors that occur on queries or during database access.

getFromIdentityMap

public java.lang.Object getFromIdentityMap(java.lang.Object domainObject)
ADVANCED: Return the object from the identity with primary and class of the given object.

getFromIdentityMap

public java.lang.Object getFromIdentityMap(java.util.Vector primaryKey,
                                           java.lang.Class theClass)
ADVANCED: Return the object from the identity with the primary and class.

getLog

public java.io.Writer getLog()
PUBLIC: Return the writer to which an accessor writes logged messages and SQL. If not set, this reference defaults to a writer on System.out. To enable logging, logMessages must be turned on.
See Also:
#logMessages()

getProfiler

public SessionProfiler getProfiler()
PUBLIC: Return the profiler. The profiler is a tool that can be used to determine performance bottlenecks. The profiler can be queries to print summaries and configure for logging purposes.

getSessionLog

public SessionLog getSessionLog()
PUBLIC: Return the session log to which an accessor logs messages and SQL. If not set, this will default to a session log on a writer on System.out. To enable logging, logMessages must be turned on.
See Also:
#logMessages()

initializeIdentityMap

public void initializeIdentityMap(java.lang.Class theClass)
PUBLIC: Reset the identity map for only the instances of the class. For inheritance the user must make sure that they only use the root class. Caution must be used in doing this to ensure that the objects within the identity map are not referenced from other objects of other classes or from the application.

initializeIdentityMapsOnServerSession

public void initializeIdentityMapsOnServerSession()
PUBLIC: Reset the identity map for only the instances of the class on the server-side session. For inheritance the user must make sure that they only use the root class. Caution must be used in doing this to ensure that the objects within the identity map are not referenced from other objects of other classes or from the application.

log

public void log(SessionLogEntry entry)
PUBLIC: Log the log entry.

printIdentityMap

public void printIdentityMap(java.lang.Class theClass)
PUBLIC: Print all instances of the specified class in the identity map. The output of this method will go the the Session's log.

printIdentityMaps

public void printIdentityMaps()
PUBLIC: Print all the objects in every identity map in this session. The output of this method will go to the Session's log.

removeFromIdentityMap

public void removeFromIdentityMap(java.lang.Object domainObject)
ADVANCED: Remove the object from the object cache. Caution should be used when calling to avoid violating object identity. The application should only call this is it knows that no references to the object exist.

removeFromIdentityMap

public void removeFromIdentityMap(java.util.Vector key,
                                  java.lang.Class theClass)
ADVANCED: Remove the object from the object cache. Caution should be used when calling to avoid violating object identity. The application should only call this is it knows that no references to the object exist.

rollbackTransaction

public void rollbackTransaction()
PUBLIC: Rollback a transaction on the database.

scrollableCursorAbsolute

public boolean scrollableCursorAbsolute(java.rmi.server.ObjID remoteScrollableCursorOid,
                                        int rows)
PUBLIC: Move the cursor to the given row number in the result set.

scrollableCursorAfterLast

public void scrollableCursorAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the end of the result set, just after the last row.

scrollableCursorBeforeFirst

public void scrollableCursorBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the front of the result set, just before the first row.

scrollableCursorClose

public void scrollableCursorClose(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Close the scrollable cursor across RMI.

scrollableCursorCurrentIndex

public int scrollableCursorCurrentIndex(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Retrieve the current row index number.

scrollableCursorFirst

public boolean scrollableCursorFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the first row in the result set.

scrollableCursorIsAfterLast

public boolean scrollableCursorIsAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is after the last row in the result set.

scrollableCursorIsBeforeFirst

public boolean scrollableCursorIsBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is before the first row in the result set.

scrollableCursorIsFirst

public boolean scrollableCursorIsFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is on the first row of the result set.

scrollableCursorIsLast

public boolean scrollableCursorIsLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Indicate whether the cursor is on the last row of the result set.

scrollableCursorLast

public boolean scrollableCursorLast(java.rmi.server.ObjID remoteScrollableCursorOid)
PUBLIC: Move the cursor to the last row in the result set

scrollableCursorNextObject

public java.lang.Object scrollableCursorNextObject(java.rmi.server.ObjID remoteScrollableCursorOid,
                                                   ReadQuery query,
                                                   RemoteSession session)
PUBLIC: Retrieve next object from the scrollable cursor.

scrollableCursorPreviousObject

public java.lang.Object scrollableCursorPreviousObject(java.rmi.server.ObjID remoteScrollableCursorOid,
                                                       ReadQuery query,
                                                       RemoteSession session)
PUBLIC: Retrieve previous object from the scrollable cursor.

scrollableCursorRelative

public boolean scrollableCursorRelative(java.rmi.server.ObjID remoteScrollableCursorOid,
                                        int rows)
PUBLIC: Move the cursor to the given row number in the result set.

scrollableCursorSize

public int scrollableCursorSize(java.rmi.server.ObjID cursorId)
PUBLIC: Return the cursor size.

setExceptionHandler

public void setExceptionHandler(ExceptionHandler exceptionHandler)
PUBLIC: Set the exceptionHandler. Exception handler can catch errors that occur on queries or during database access.

setLog

public void setLog(java.io.Writer log)
PUBLIC: Set the writer to which an accessor writes logged messages and SQL. If not set, this reference defaults to a writer on System.out. To enable logging logMessages() is used.
See Also:
#logMessages()

setLogin

public void setLogin(DatabaseLogin login)
PUBLIC: Set the login.

setProfiler

public void setProfiler(SessionProfiler profiler)
PUBLIC: Set the profiler for the session. This allows for performance operations to be profiled.

setSessionLog

public void setSessionLog(SessionLog sessionLog)
PUBLIC: Set the session log to which an accessor logs messages and SQL. If not set, this will default to a session log on a writer on System.out. To enable logging, logMessages must be turned on.
See Also:
#logMessages()

setShouldLogMessages

public void setShouldLogMessages(boolean shouldLogMessages)
PUBLIC: Set messages logging. Message logging will dump all SQL executed through TopLink to the session's log. By default this is System.out, but can be set to any Writer.
See Also:
setLog(Writer)

shouldLogMessages

public boolean shouldLogMessages()
PUBLIC: Return if all messages such as executed SQL commands should be logged.

validateCache

public void validateCache()
ADVANCED: This can be used to help debugging an object identity problem. An object identity problem is when an object in the cache references an object not in the cache. This method will validate that all cached objects are in a correct state.

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.