Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server
Class SessionImpl

java.lang.Object
  extended byoracle.jbo.server.SessionImpl
All Implemented Interfaces:
Session

public class SessionImpl
extends java.lang.Object
implements Session

The default server-side implementation of the Session interface. A session context represents an application's session. A session object is instantiated for each root application module when the application module is activated (see ApplicationModuleImpl.activate()). The session object is garbage collected when the root application module is garbage collected.

This class may be extended by application developers who are interested in loading session specific context at session instantiation. For example, an application may extend the init method with logic to load application specific context like the local currency into the session context. Additionally, the getTransactionHandlerFactory may be overriden by an extending class to return a custom TransactionHandlerFactory.

Custom implementations of this interface may be identified to the framework with the SessionClass server property.

Since:
JDeveloper 3.0

Field Summary
protected  oracle.jbo.server.security.JboJAASContext mJAASContext
           
 
Fields inherited from interface oracle.jbo.Session
JBO_SESSION_COOKIE, JBO_SESSION_LOCALE
 
Constructor Summary
SessionImpl()
          This constructor is called by the framework to initialize the client session
 
Method Summary
static SessionContextManager findOrCreateSessionContextManager()
           
 java.lang.String[] getAllApplicationModuleDefNames()
          Gets the names of the Application Module definitions contained in all packages.
 java.lang.String[] getAllEntityAssociationDefNames()
          Gets the names of the entity association definitions defined in all packages.
 java.lang.String[] getAllEntityDefNames()
          Gets the names of the Entity Object definitions available in all packages.
 java.lang.String[] getAllViewDefNames()
          Gets the names of the View Object definitions available in all packages.
 java.lang.String[] getAllViewLinkDefNames()
          Gets the names of the View Link definitions defined in all packages.
 java.lang.String[] getApplicationModuleDefNames(java.lang.String packName)
          Gets the names of the Application Module definitions contained in a package.
 java.lang.String[] getEntityAssociationDefNames(java.lang.String packName)
          Gets the names of the entity association definitions defined in a package.
 java.lang.String[] getEntityDefNames(java.lang.String packName)
          Gets the names of the Entity Object definitions available in a package.
 java.util.Hashtable getEnvironment()
          Returns the BC4J context for the session.
 java.util.Locale getLocale()
          Gets the current Locale used for localizing error messages.
 LocaleContext getLocaleContext()
          retrieves the locale context for the session
 java.lang.String[] getPackageNames()
          Gets names of the packages that make up this middle tier application.
static SessionContextManager getSessionContextManager()
           
 javax.security.auth.Subject getSubject()
          Returns the current JAAS SUbject
 TransactionHandlerFactory getTransactionHandlerFactory()
          Get the session's transaction handler factory.
 java.util.Hashtable getUserData()
          Returns application context for the session.
 java.lang.String getUserPrincipalName()
          Returns the JAAS user principal name.
 java.lang.String[] getUserRoles()
          Returns the Roles/Groups for current user principal.
 java.lang.String getVersion()
          Gets the middle tier's version information.
 java.lang.String[] getViewDefNames(java.lang.String packName)
          Gets the names of the View Object definitions available in a package.
 java.lang.String[] getViewLinkDefNames(java.lang.String packName)
          Gets the names of the View Link definitions defined in a package.
static SessionImpl init(java.util.Hashtable ctxEnv)
          Internal: Applications should not use this method.
 boolean isClient()
          Returns whether this session is running as a client in 3 tier or not.
 boolean isUserInRole(java.lang.String role)
           
 void loadPackage(java.lang.String packageName)
          Loads a package that may be browsed for defined objects.
 void setLocale(java.util.Locale l)
          Sets a new Locale for localizing error messages.
 void setProperty(java.lang.String name, java.lang.String value)
           
static void setSessionContextManager(SessionContextManager iMgr)
           
 void setTransactionHandlerFactory(TransactionHandlerFactory fac)
          Set the session's transaction handler factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mJAASContext

protected oracle.jbo.server.security.JboJAASContext mJAASContext
Constructor Detail

SessionImpl

public SessionImpl()
This constructor is called by the framework to initialize the client session

Method Detail

init

public static SessionImpl init(java.util.Hashtable ctxEnv)
Internal: Applications should not use this method.


getEnvironment

public java.util.Hashtable getEnvironment()
Description copied from interface: Session
Returns the BC4J context for the session. Examples of BC4J context include the values for the BC4J properties defined in PropertyMetadata. Applications should store custom session context in the Session userdata.

Specified by:
getEnvironment in interface Session
Returns:
a hashtable of BC4J session properties
See Also:
Session.getUserData()

getLocale

public java.util.Locale getLocale()
Description copied from interface: Session
Gets the current Locale used for localizing error messages.

Specified by:
getLocale in interface Session
Returns:
the current Locale.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)

setLocale

public void setLocale(java.util.Locale l)
Description copied from interface: Session
Sets a new Locale for localizing error messages.

Specified by:
setLocale in interface Session
Parameters:
l - the new Locale.

loadPackage

public void loadPackage(java.lang.String packageName)
Description copied from interface: Session
Loads a package that may be browsed for defined objects.

Specified by:
loadPackage in interface Session
Parameters:
packageName - a fully qualified package name.

getVersion

public java.lang.String getVersion()
Description copied from interface: Session
Gets the middle tier's version information.

Specified by:
getVersion in interface Session
Returns:
The version information in the form major.minor.patch.bldNum.

getApplicationModuleDefNames

public java.lang.String[] getApplicationModuleDefNames(java.lang.String packName)
Description copied from interface: Session
Gets the names of the Application Module definitions contained in a package.

Specified by:
getApplicationModuleDefNames in interface Session
Parameters:
packName - the name of the package.
Returns:
an array of ApplicationModule definition names.

getAllApplicationModuleDefNames

public java.lang.String[] getAllApplicationModuleDefNames()
Description copied from interface: Session
Gets the names of the Application Module definitions contained in all packages.

Specified by:
getAllApplicationModuleDefNames in interface Session
Returns:
an array of ApplicationModule definition names.

getViewDefNames

public java.lang.String[] getViewDefNames(java.lang.String packName)
Description copied from interface: Session
Gets the names of the View Object definitions available in a package.

Specified by:
getViewDefNames in interface Session
Parameters:
packName - the name of the package.
Returns:
String[] an array of ViewDef names.

getAllViewDefNames

public java.lang.String[] getAllViewDefNames()
Description copied from interface: Session
Gets the names of the View Object definitions available in all packages.

Specified by:
getAllViewDefNames in interface Session
Returns:
String[] an array of ViewDef names.

getEntityDefNames

public java.lang.String[] getEntityDefNames(java.lang.String packName)
Description copied from interface: Session
Gets the names of the Entity Object definitions available in a package.

Specified by:
getEntityDefNames in interface Session
Parameters:
packName - the name of the package.
Returns:
String[] an array of EntityDef names.

getAllEntityDefNames

public java.lang.String[] getAllEntityDefNames()
Description copied from interface: Session
Gets the names of the Entity Object definitions available in all packages.

Specified by:
getAllEntityDefNames in interface Session
Returns:
String[] an array of EntityDef names.

getEntityAssociationDefNames

public java.lang.String[] getEntityAssociationDefNames(java.lang.String packName)
Description copied from interface: Session
Gets the names of the entity association definitions defined in a package.

Specified by:
getEntityAssociationDefNames in interface Session
Parameters:
packName - the name of the package.
Returns:
String[] an array of EntityAssociationDef names.

getAllEntityAssociationDefNames

public java.lang.String[] getAllEntityAssociationDefNames()
Description copied from interface: Session
Gets the names of the entity association definitions defined in all packages.

Specified by:
getAllEntityAssociationDefNames in interface Session
Returns:
String[] an array of EntityAssociationDef names.

getViewLinkDefNames

public java.lang.String[] getViewLinkDefNames(java.lang.String packName)
Description copied from interface: Session
Gets the names of the View Link definitions defined in a package.

Specified by:
getViewLinkDefNames in interface Session
Parameters:
packName - the name of the package.
Returns:
String[] an array of ViewLinkDef names.

getAllViewLinkDefNames

public java.lang.String[] getAllViewLinkDefNames()
Description copied from interface: Session
Gets the names of the View Link definitions defined in all packages.

Specified by:
getAllViewLinkDefNames in interface Session
Returns:
String[] an array of ViewLinkDef names.

getPackageNames

public java.lang.String[] getPackageNames()
Description copied from interface: Session
Gets names of the packages that make up this middle tier application.

Specified by:
getPackageNames in interface Session
Returns:
The package names.

getTransactionHandlerFactory

public TransactionHandlerFactory getTransactionHandlerFactory()
Get the session's transaction handler factory. This method may be overriden by a custom Session implementation to return a custom implementation of the TransactionHandlerFactory interface.

See Also:
TransactionHandler, TransactionHandlerFactory

getSessionContextManager

public static SessionContextManager getSessionContextManager()

setSessionContextManager

public static void setSessionContextManager(SessionContextManager iMgr)

findOrCreateSessionContextManager

public static SessionContextManager findOrCreateSessionContextManager()

setTransactionHandlerFactory

public void setTransactionHandlerFactory(TransactionHandlerFactory fac)
Set the session's transaction handler factory. This method may be invoked to set a custom implementation of the TransactionHandlerFactory for the session before connect is invoked on the root application module's transaction.

See Also:
TransactionHandler, TransactionHandlerFactory

getLocaleContext

public LocaleContext getLocaleContext()
Description copied from interface: Session
retrieves the locale context for the session

Specified by:
getLocaleContext in interface Session

getUserData

public java.util.Hashtable getUserData()
Description copied from interface: Session
Returns application context for the session. Applications may store any custom session data in this Hashtable. This hashtable will be reset by {@link oracle.jbo.server.ApplicationModuleImpl.prepareSession(Session).

Specified by:
getUserData in interface Session

getUserPrincipalName

public java.lang.String getUserPrincipalName()
Returns the JAAS user principal name.


isUserInRole

public boolean isUserInRole(java.lang.String role)
Specified by:
isUserInRole in interface Session
Parameters:
role - the name of the role.
Returns:
true if the user is in role; false otherwise.

isClient

public boolean isClient()
Description copied from interface: Session
Returns whether this session is running as a client in 3 tier or not.

Specified by:
isClient in interface Session
Returns:
true if the session is in 3 tier. false if in 2 tier.

getSubject

public javax.security.auth.Subject getSubject()
Returns the current JAAS SUbject


getUserRoles

public java.lang.String[] getUserRoles()
Returns the Roles/Groups for current user principal.

Specified by:
getUserRoles in interface Session

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.