|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IServiceLocator
This Interface provides JNDI naming contexts and takes an object through approaching to the JNDI Server or Naming Server.
The object once looked up is saved in cache, and fetched when it is called again. This Service searches objects like as UserTransaction, DataSource, EJBHome Object at JNDI Server to offer them to the client.(Other objects use look up method). Context information of WAS shoud be defined in xconf file of Naming Service. Naming Service uses Cache Service internally, so they should be distributed together.
| Attibute | Description | REQ/OPT (default value) |
| name | representative name used for finding appropriate context. | Requred |
| key | attribute name used for creating InitialContext. | Requred |
| value | attribute value corresponding a context. | Requred |
Configuration Example:
for Weblogic
<bean name="serviceLocator"
class=anyframe.core.services.utility.IServiceLocator>
<config:configuration>
<context name="default" key="java.naming.provider.url"
value="t3://localhost:7001"/>
<context name="default" key="java.naming.factory.initial"
value="weblogic.jndi.WLInitialContextFactory"/>
<usertx name="default" key="javax.transaction.UserTransaction"/>
</config:configuration>
</bean>
for Websphere
<bean name="serviceLocator"
class=anyframe.core.services.utility.IServiceLocator>
<config:configuration>
<cache>true</cache>
<context name="default" key="java.naming.provider.url"
value=" iiop://localhost:2809"/>
<context name="default" key="java.naming.factory.initial"
value="com.ibm.websphere.naming.WsnInitialContextFactory "/>
<usertx name="default" key="javax.transaction.UserTransaction"/>
</config:configuration>
</bean>
for Jeus
<bean name="serviceLocator"
class=anyframe.core.services.utility.IServiceLocator>
<config:configuration>
<cache>true</cache>
<context name="default" key="java.naming.provider.url"
value="localhost:9736"/>
<context name="default" key="java.naming.factory.initial"
value=" jeus.jndi.JEUSContextFactory "/>
<usertx name="default" key=" java:comp/UserTransaction "/>
</config:configuration>
</bean>
| Field Summary | |
|---|---|
static Log |
LOGGER
|
static String |
ROLE
|
| Method Summary | |
|---|---|
Context |
getContext(String context)
Return the Context with the specified name. |
DataSource |
getDataSource(String dsName)
Using a default context, get DataSource Object from JNDI Server. |
DataSource |
getDataSource(String dsName,
String context)
Using a context, get DataSource Object from JNDI Server. |
Object |
getEJBHome(String ejbName)
Using a default context, get EJBHome Object from JNDI Server. |
Object |
getEJBHome(String ejbName,
Class classType)
Using a default context, get EJBHome Object narrow casting from JNDI Server. |
Object |
getEJBHome(String ejbName,
Class classType,
String context)
Using a context, get EJBHome Object narrow casting from JNDI Server. |
Object |
getEJBHome(String ejbName,
String context)
Using a context, get EJB Home Object from JNDI Server. |
UserTransaction |
getUserTransaction()
Using a default context, get UserTransaction Object from JNDI Server. |
UserTransaction |
getUserTransaction(String context)
Using a context, get UserTransaction Object from JNDI Server. |
Object |
lookup(String name)
Using a default context, get Object from JNDI Server. |
Object |
lookup(String name,
String context)
Using a context, get Object from JNDI Server. |
| Field Detail |
|---|
static final String ROLE
static final Log LOGGER
| Method Detail |
|---|
Context getContext(String context)
context - The name of the context.
UserTransaction getUserTransaction()
throws BaseException
Using a default context in configuration files, get UserTransaction Object from JNDI Server to do Naming Service.
BaseException - if an error occurs
UserTransaction getUserTransaction(String context)
throws BaseException
Using a defined context in configuration files, get UserTransaction Object from JNDI Server to do Naming Service.
context - context name that exists in configuration files
BaseException - if an error occurs.
DataSource getDataSource(String dsName)
throws BaseException
Using a defined default context in configuration files, get DataSource Object from JNDI Server to do Naming Service.
dsName - context name that exists in configuration files
BaseException - if an error occurs
DataSource getDataSource(String dsName,
String context)
throws BaseException
Using a defined context in configuration files, get DataSource Object from JNDI Server to do Naming Service.
dsName - assigned JNDI name in dsName JNDI Servercontext - context name that exists in configuration files
BaseException - if an error occurs
Object getEJBHome(String ejbName)
throws BaseException
Using a defined default context in configuration files, get EJBHome Object from JNDI Server to do Naming Service.
ejbName - assigned JNDI name in ejbName JNDI Server
BaseException - if an error occurs
Object getEJBHome(String ejbName,
String context)
throws BaseException
Using a defined context in configuration files, get EJBHome Object from JNDI Server to do Naming Service.
ejbName - assigned JNDI name in ejbName JNDI Servercontext - context name that exists in configuration files
BaseException - if an error occurs
Object getEJBHome(String ejbName,
Class classType)
throws BaseException
Using a defined default context in configuration files, narrow casting EJBHome Object which is get from JNDI Server to do Naming Service. When EJBHome exists in remote, it make use
ejbName - assigned JNDI name in ejbName JNDI ServerclassType - classType narrow casting
BaseException - if an error occurs
Object getEJBHome(String ejbName,
Class classType,
String context)
throws BaseException
Using a defined default context in configuration files, narrow casting EJBHome Object which is get from JNDI Server to do Naming Service. When EJBHome exists in remote, it make use
ejbName - assigned JNDI name in ejbName JNDI ServerclassType - classType narrow castingcontext - context name that exists in configuration files
BaseException - if an error occurs
Object lookup(String name)
throws BaseException
Using a defined default context in configuration files, get Object from JNDI Server to do Naming Service.
name - assigned JNDI name in name JNDI Server
BaseException - if an error occurs
Object lookup(String name,
String context)
throws BaseException
Using a defined default context in configuration files, get Object from JNDI Server to do Naming Service.
name - assigned JNDI name in name JNDI Servercontext - context name that exists in configuration files
BaseException - if an error occurs
|
Anyframe Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||