Re: [jboss-dev-forums] [Javassist Development] - CtClass getNestedClasses() returns the same class when applied to an anonymous class
by Dam Dam
Dam Dam [http://community.jboss.org/people/damdamdam] replied to the discussion
"CtClass getNestedClasses() returns the same class when applied to an anonymous class"
To view the discussion, visit: http://community.jboss.org/message/543621#543621
--------------------------------------------------------------
Another issue about this method :
I have my anonymous class "com.bla.MyClass$1", which contains another anonymous class, which gives "com.bla.MyClass$1$1".
When I try the getNestedClasses on the first class, it returns the second class (normal I guess, because it is nested), and the first one itself (first bug explained before).
But when I try the getNestedClass on the second class "com.bla.MyClass$1$1", it returns the class itself (the same bug), BUT it returns the declaring class "com.bla.MyClass$1". Gets me in an infinite loop !
I am trying to search where the problem comes from to fix it. If it's not possible, i would like to know if a class is an anonymous : would be great to have an isAnonymous() method on a CtClass.
Can anybody confirm me he gets the same thing ? And if it is a bug (if not, that's really weird) ?
Anyway, thanks a lot for the brilliant work, javassist helps me a lot in my everyday work !
Dam.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543621#543621]
Start a new discussion in Javassist Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years
[EJB Development] - how to call SLSB from struts action class ?
by paresh bhavsar
paresh bhavsar [http://community.jboss.org/people/bhavsar.er] created the discussion
"how to call SLSB from struts action class ?"
To view the discussion, visit: http://community.jboss.org/message/543618#543618
--------------------------------------------------------------
Hi,
Please note that i am using ejb 3.0 first time and having all Stateless beans in my application at present. we are using struts action classes for accessing SLSB in the following manner. Kindly let me know are we doing it in the right manner ?
public class EksServiceFactory {
private static EksServiceFactory factory = null;
private static Map<String,Object> localsMap = null;
private Context ctx=null;
private EksServiceFactory() throws NamingException {
ctx = new InitialContext();
localsMap = new HashMap<String, Object>();
}
public static synchronized EksServiceFactory getInstance() throws NamingException{
if(factory == null){
factory = new EksServiceFactory();
}
return factory;
}
public Object getEksService(String jndiName) throws NamingException {
Object obj = localsMap.get(jndiName);
if(obj==null) {
obj = ctx.lookup(jndiName);
localsMap.put(jndiName, obj);
}
return obj;
}
} getEksService(String jndiName) throws NamingException {
EksService eksService = (EksService)localsMap.get(jndiName);
if(eksService==null) {
eksService = (EksService)ctx.lookup(jndiName);
localsMap.put(jndiName, eksService);
}
return eksService;
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/543618#543618]
Start a new discussion in EJB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years