[jboss-dev-forums] [EJB3 Development] - Invoke remote ejb's with additional custom properties

vedanth k r do-not-reply at jboss.com
Thu Jun 14 05:33:30 EDT 2012


vedanth k r [https://community.jboss.org/people/vedanth] created the discussion

"Invoke remote ejb's with additional custom properties"

To view the discussion, visit: https://community.jboss.org/message/741686#741686

--------------------------------------------------------------
Hi All
         I have deployed stateless beans in jboss as 7 and i use a remote ejb client to access the deployed ejb's every thing seems to work fine with the below code. 


Remote client code:


*Hashtable p = new Hashtable();*
*      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");*
*      p.put(Context.PROVIDER_URL, "remote://localhost:4547/");*
*      p.put("jboss.naming.client.ejb.context", true);*
*      p.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");*
*      p.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");*
*      final Context context = new javax.naming.InitialContext(p);*


*context.lookup("ejb:employee/employeeService//EmployeeManagementImpl!my.tests.EmployeeManagement");*


Now i want to set additional properties in the context and get the same properties in the deployed stateless beans.


Set something like *context.addToEnvironment("customDataKey", "customDataValue");* in client code 
and get the same properties in deployed beans like


*@Resource*
*EJBContext ejbContext;*


*ejbContext.getEnvironment();*
*or*
*ejbContext.getContextData()*


Is it possible to do this???? or any other alternative.....
Am confused as to how to achieve this.


Thanks in advance...
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/741686#741686]

Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120614/c5098844/attachment.html 


More information about the jboss-dev-forums mailing list