/** * Returns the type of configuration object this config proxy represents. * @param element is the configuration object * @return the configuration interface class */ public static <T extends ConfigBeanProxy> Class<T> proxyType(T element) { ConfigView bean = getImpl(element); return bean.getProxyType(); }
@Override public <T extends ConfigBeanProxy> Class<T> getProxyType() { return masterView.getProxyType(); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { T configBeanProxy = revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { T configBeanProxy = ConfigSupport.revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = ConfigSupport.getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
@SuppressWarnings("unchecked") public <T extends ConfigBeanProxy> T transform(T source) { final ConfigView handler = (ConfigView) Proxy.getInvocationHandler(source); return (T) handler.getMasterView().getProxy(handler.getMasterView().getProxyType()); } };
@Override public <T extends ConfigBeanProxy> Class<T> getProxyType() { return masterView.getProxyType(); }
public <T extends ConfigBeanProxy> Class<T> getProxyType() { return masterView.getProxyType(); }
+ ConfigSupport.getImpl(ejb).getMasterView().getClass().getName()); System.out.println("getImpl(ejb).getProxyType() == > " + ConfigSupport.getImpl(ejb).getProxyType().getClass().getName()); } catch (Exception e) { e.printStackTrace();
/** * Returns the type of configuration object this config proxy represents. * @param element is the configuration object * @return the configuration interface class */ public static <T extends ConfigBeanProxy> Class<T> proxyType(T element) { ConfigView bean = getImpl(element); return bean.getProxyType(); }
/** * Returns the type of configuration object this config proxy represents. * @param element is the configuration object * @return the configuration interface class */ public static <T extends ConfigBeanProxy> Class<T> proxyType(T element) { ConfigView bean = getImpl(element); return bean.getProxyType(); }
/** * Returns the type of configuration object this config proxy represents. * @param element is the configuration object * @return the configuration interface class */ public static <T extends ConfigBeanProxy> Class<T> proxyType(T element) { ConfigView bean = getImpl(element); return bean.getProxyType(); }
/** * Returns the type of configuration object this config proxy represents. * @param element is the configuration object * @return the configuration interface class */ public static <T extends ConfigBeanProxy> Class<T> proxyType(T element) { ConfigView bean = getImpl(element); return bean.getProxyType(); }
@Override public <T extends ConfigBeanProxy> Class<T> getProxyType() { return masterView.getProxyType(); }
public <T extends ConfigBeanProxy> T getNamedConfigBeanFromCollection(Collection<T> col, String nameToLookFor, Class typeOfObjects) throws InvocationTargetException, IllegalAccessException { if (nameToLookFor == null) return null; for (Object item : col) { if (!((ConfigView) Proxy.getInvocationHandler(item)).getProxyType().isAssignableFrom(typeOfObjects)) { continue; } String name = getNameForConfigBean(item, typeOfObjects); if (nameToLookFor.equalsIgnoreCase(name)) { return (T) item; } } return null; }
@SuppressWarnings("unchecked") public <T extends ConfigBeanProxy> T transform(T source) { final ConfigView handler = (ConfigView) Proxy.getInvocationHandler(source); return (T) handler.getMasterView().getProxy(handler.getMasterView().getProxyType()); } };
@SuppressWarnings("unchecked") public <T extends ConfigBeanProxy> T transform(T source) { final ConfigView handler = (ConfigView) Proxy.getInvocationHandler(source); return (T) handler.getMasterView().getProxy(handler.getMasterView().getProxyType()); } };
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { T configBeanProxy = revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
@SuppressWarnings("unchecked") public <T extends ConfigBeanProxy> T transform(T source) { final ConfigView handler = (ConfigView) Proxy.getInvocationHandler(source); return (T) handler.getMasterView().getProxy(handler.getMasterView().getProxyType()); } };