Accessing local: namespace

The local: name space contains references to enterprise beans with local interfaces. There is only one local: name space in a server process. You can invoke the NameServer MBean associated with that server process to dump the local: name space.

When you execute dumpNameSpace utility, it wont list out the references bound in local namespace in order to get those references you will have to use the following wsadmin script


def printLocalNameSpace(processname):
print "Printing Local name space for " + processname
nameserver =AdminControl.queryNames("*:*,type=NameServer,process="+processname)
print AdminControl.invoke(nameserver,"dumpLocalNameSpace",'["-report long"]')

printLocalNameSpace('server2')


The printLocalNameSpace function takes one argument, which is name of the server process and prints out the local name space on that server.

I do have only one EJB that has local interface, so when i tried executing the script i got this output


WASX7209I: Connected to process "dmgr" on node dmgrCellManager01 using SOAP connector; The type of process is: DeploymentManager
Printing Local name space for server2
==============================================================================
Name Space Dump
Starting context: (top)=local:
Time of dump: Tue Sep 08 19:25:11 PDT 2009
==============================================================================
==============================================================================
Beginning of Name Space Dump
==============================================================================
1 (top)
1 Bound Java type:
1 Local Java type: com.ibm.ws.naming.urlns.genericURLContextRoot
1 Corba binding type: org.omg.CosNaming.BindingType.ncontext
1 Context unique ID: ROOT CONTEXT
1 String representation: com.ibm.ws.naming.urlns.genericURLContextRoot(local:)
2 (top)/ejb
2 Bound Java type: javax.naming.Context
2 Local Java type: com.ibm.ws.naming.urlns.genericURLContext
2 Corba binding type: org.omg.CosNaming.BindingType.ncontext
2 Context unique ID: 9c02fd68-0123-ea43-3286-c0a8026baa77
2 String representation: com.ibm.ws.naming.urlns.genericURLContext(local:ejb)
3 (top)/ejb/ejb
3 Bound Java type: javax.naming.Context
3 Local Java type: com.ibm.ws.naming.urlns.genericURLContext
3 Corba binding type: org.omg.CosNaming.BindingType.ncontext
3 Context unique ID: 9c9a91b8-0123-ea76-4936-c0a8026baa77
3 String representation: com.ibm.ws.naming.urlns.genericURLContext(local:ejb/ejb)
4 (top)/ejb/ejb/ejbs
4 Bound Java type: javax.naming.Context
4 Local Java type: com.ibm.ws.naming.urlns.genericURLContext
4 Corba binding type: org.omg.CosNaming.BindingType.ncontext
4 Context unique ID: 9c9a91b9-0123-eb89-5cb4-c0a8026baa77
4 String representation: com.ibm.ws.naming.urlns.genericURLContext(local:ejb/ejb/ejbs)
5 (top)/ejb/ejb/ejbs/NameSpaceHome
5 Bound Java type: ejbs.EJSLocalStatelessNameSpaceHome_05679dcd
5 Local Java type: ejbs.EJSLocalStatelessNameSpaceHome_05679dcd
5 String representation: ejbs.EJSLocalStatelessNameSpaceHome_05679dcd@6df66df6(BeanId(__homeOfHomes#__homeOfHomes#__homeOfHomes, NameSpace#NameSpaceEJB.jar#NameSpace))
==============================================================================
End of Name Space Dump
==============================================================================
code>

As you can see the local Home interface for my EJB is bound to /ejb/ejb/ejbs/NameSpaceHome and the local namespace only has bindings related to it

No comments: