Methods Summary |
---|
public T | getAnnotation(java.lang.Class annotationClass, java.lang.Class clazz)
return clazz.getAnnotation(annotationClass);
|
public T | getAnnotation(java.lang.Class annotationClass, java.lang.Class clazz, java.lang.reflect.Method method)
return method.getAnnotation(annotationClass);
|
public T | getAnnotation(java.lang.Class annotationClass, java.lang.reflect.Method method)
return method.getAnnotation(annotationClass);
|
public T | getAnnotation(java.lang.Class annotationClass, java.lang.Class clazz, java.lang.reflect.Field field)
return field.getAnnotation(annotationClass);
|
public T | getAnnotation(java.lang.Class annotationClass, java.lang.reflect.Field field)
return field.getAnnotation(annotationClass);
|
public java.lang.ClassLoader | getClassloader()
//throw new RuntimeException("NYI");
return Thread.currentThread().getContextClassLoader();
|
public org.jboss.ejb3.DependencyPolicy | getDependencyPolicy()
throw new RuntimeException("NYI");
|
public java.lang.String | getDeploymentDescriptorType()
return "application-client.xml";
|
public java.lang.String | getEjbJndiName(java.lang.Class businessInterface)
throw new RuntimeException("NYI");
//return null;
|
public java.lang.String | getEjbJndiName(java.lang.String link, java.lang.Class businessInterface)
throw new NotImplementedException();
//return "java:comp/env/" + link + "/remote";
//return applicationClientName + "/" + link + "/remote";
//return null;
|
public javax.naming.Context | getEnc()
return enc;
|
public java.util.Map | getEncInjections()
return encInjections;
|
public java.util.Map | getEncInjectors()
return encInjectors;
|
public org.jboss.metamodel.descriptor.EnvironmentRefGroup | getEnvironmentRefGroup()
return xml;
|
public java.lang.String | getIdentifier()
// throw new NotImplementedException;
// FIXME: return the real identifier
//return "client-identifier";
return applicationClientName;
|
public java.util.List | getInjectors()
throw new NotImplementedException();
|
public java.lang.Class | getMainClass()
return mainClass;
|
public org.jboss.ejb3.entity.PersistenceUnitDeployment | getPersistenceUnitDeployment(java.lang.String unitName)
throw new NotImplementedException();
|
public void | invokeMain(java.lang.String[] args)
Class parameterTypes[] = { args.getClass() };
Method method = mainClass.getDeclaredMethod("main", parameterTypes);
method.invoke(null, (Object) args);
|
private void | postConstruct()Call post construct methods.
log.info("postConstructs = " + postConstructs);
for(Method method : postConstructs)
{
method.setAccessible(true);
Object instance;
if(Modifier.isStatic(method.getModifiers()))
instance = null;
else
instance = method.getDeclaringClass().newInstance();
Object args[] = null;
method.invoke(instance, args);
}
|
private void | processMetadata(org.jboss.ejb3.DependencyPolicy dependencyPolicy)
processPostConstructs();
// TODO: check which handlers a client container should support
Collection<InjectionHandler> handlers = new ArrayList<InjectionHandler>();
handlers.add(new EJBHandler());
//handlers.add(new ClientEJBHandler());
handlers.add(new DependsHandler());
handlers.add(new JndiInjectHandler());
handlers.add(new PersistenceContextHandler());
handlers.add(new PersistenceUnitHandler());
handlers.add(new ResourceHandler());
handlers.add(new WebServiceRefHandler());
// TODO: we're going to use a jar class loader
// ClassLoader old = Thread.currentThread().getContextClassLoader();
// Thread.currentThread().setContextClassLoader(classloader);
try
{
// EJB container's XML must be processed before interceptor's as it may override interceptor's references
for (InjectionHandler handler : handlers) handler.loadXml(xml, this);
Map<AccessibleObject, Injector> tmp = InjectionUtil.processAnnotations(this, handlers, getMainClass());
injectors.addAll(tmp.values());
// initialiseInterceptors();
// for (InterceptorInfo interceptorInfo : applicableInterceptors)
// {
// for (InjectionHandler handler : handlers)
// {
// handler.loadXml(interceptorInfo.getXml(), this);
// }
// }
// for (InterceptorInfo interceptorInfo : applicableInterceptors)
// {
// Map<AccessibleObject, Injector> tmpInterceptor = InjectionUtil.processAnnotations(this, handlers, interceptorInfo.getClazz());
// InterceptorInjector injector = new InterceptorInjector(this, interceptorInfo, tmpInterceptor);
// interceptorInjectors.put(interceptorInfo.getClazz(), injector);
// }
}
finally
{
// Thread.currentThread().setContextClassLoader(old);
}
|
private void | processPostConstructs()Create dummy dd for PostConstruct annotations.
processPostConstructs(mainClass);
for(LifecycleCallback callback : xml.getPostConstructs())
{
String className = callback.getLifecycleCallbackClass();
String methodName = callback.getLifecycleCallbackMethod();
Class lifecycleClass;
if(className == null)
lifecycleClass = mainClass;
else
lifecycleClass = Thread.currentThread().getContextClassLoader().loadClass(className);
Class parameterTypes[] = new Class[0];
Method method = lifecycleClass.getDeclaredMethod(methodName, parameterTypes);
postConstructs.add(method);
}
|
private void | processPostConstructs(java.lang.Class cls)
if(cls == null)
return;
for(Method method : cls.getDeclaredMethods())
{
PostConstruct postConstruct = method.getAnnotation(PostConstruct.class);
if(postConstruct != null)
{
// TODO: sure?
// http://java.sun.com/javase/6/docs/api/javax/annotation/PostConstruct.html
if(postConstructs.size() > 0)
throw new IllegalStateException("only one @PostConstruct allowed");
postConstructs.add(method);
}
}
processPostConstructs(cls.getSuperclass());
|
public org.jboss.ejb3.Container | resolveEjbContainer(java.lang.String link, java.lang.Class businessIntf)
log.warn("resolveEjbContainer(" + link + ", " + businessIntf + ") not implemented");
return null;
|
public org.jboss.ejb3.Container | resolveEjbContainer(java.lang.Class businessIntf)
return null;
|