private void outjectAttributes(Object bean, boolean enforceRequired) { for ( BijectedAttribute<Out> att: getOutAttributes() ) { outjectAttribute( att.getAnnotation(), att.getName(), bean, att.get(bean), enforceRequired ); } }
private void injectAttributes(Object bean, boolean enforceRequired) { for ( BijectedAttribute<In> att : getInAttributes() ) { att.set( bean, getValueToInject( att.getAnnotation(), att.getName(), bean, enforceRequired ) ); } }
public Object getComponentInstance(String key, boolean create) { return Component.getInstance( qualifyName(key), create ); }
public static HibernatePersistenceProvider instance() { return (HibernatePersistenceProvider) Component.getInstance(HibernatePersistenceProvider.class, ScopeType.STATELESS); } }
public void callDestroyMethod(Object instance) { if ( hasDestroyMethod() ) { callComponentMethod( instance, getDestroyMethod() ); } }
private Object unwrap(Object instance) { if ( hasUnwrapMethod() ) { return callComponentMethod( instance, getUnwrapMethod() ); } else { return instance; } }
protected Component getComponent() { if (component==null) { component = Component.forName(componentName); } return component; }
public void callPreDestroyMethod(Object instance) { if ( hasPreDestroyMethod() ) { callComponentMethod( instance, getPreDestroyMethod() ); } }
public void callPostActivateMethod(Object instance) { if ( hasPostActivateMethod() ) { callComponentMethod( instance, getPostActivateMethod() ); } }
/** * Returns the class of an entity bean instance * * @param bean * The entity bean instance * @return The class of the entity bean */ public Class getBeanClass(Object bean) { return Entity.forBean(bean).getBeanClass(); }
public Component(Class<?> clazz, Context applicationContext) { this( clazz, getComponentName(clazz), Seam.getComponentScope(clazz), false, new String[0], null, applicationContext ); }
protected void postConstructEntityBean(Object bean) throws Exception { initialize(bean); }
public BijectedProperty(String name, Method getter, Method setter, T annotation) { this.getter = new BijectedMethod(name, getter, annotation); this.setter = new BijectedMethod(name, setter, annotation); }
@Override public Object proceed() throws Exception { component.callPostConstructMethod(bean); return null; }
@Override public Object proceed() throws Exception { component.callPrePassivateMethod(bean); return null; }
private void outjectDataModels(Object bean) { for ( BijectedAttribute dataModelGetter: dataModelGetters ) { outjectDataModel(bean, dataModelGetter); } }
/** * Is the class a container-generated proxy class for an * entity bean? */ public static boolean isEntityClass(Class<?> clazz) { return getEntityClass(clazz)!=null; }
/** * Helper method for resolving components in the test script. */ protected Object getInstance(Class clazz) { return Component.getInstance(clazz); }
public Object getComponentInstance(String key, boolean create, boolean allowAutocreation) { return Component.getInstance( qualifyName(key), create, allowAutocreation ); }
/** * Helper method for resolving components in the test script. */ protected Object getInstance(String name) { return Component.getInstance(name); }