public WriteableView(ConfigBeanProxy readView) { this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView(); this.defaultView = bean.createProxy(); changedAttributes = new HashMap<String, PropertyChangeEvent>(); changedCollections = new HashMap<String, ProtectedList>(); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object */ <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) { return allocate(type).createProxy(type); }
param = ((WriteableView) handler).getMasterView().createProxy( (Class<ConfigBeanProxy>) master.getImplementationClass());
public static ConfigBeanProxy deepCopy(ConfigBeanProxy self, ConfigBeanProxy parent) throws TransactionFailure { ConfigBean configBean = (ConfigBean) Dom.unwrap(self); // ensure the parent is locked Transaction t = Transaction.getTransaction(parent); if (t==null) { throw new TransactionFailure("Must use a locked parent config object for copying new config object"); } ConfigBean copy = configBean.copy(configBean.parent()); return t.enroll(copy.createProxy()); }
public WriteableView(ConfigBeanProxy readView) { this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView(); this.defaultView = bean.createProxy(); changedAttributes = new HashMap<String, PropertyChangeEvent>(); changedCollections = new HashMap<String, ProtectedList>(); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object */ <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) { return allocate(type).createProxy(type); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object */ <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) { return allocate(type).createProxy(type); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object */ <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) { return allocate(type).createProxy(type); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object */ <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) { return allocate(type).createProxy(type); }
public WriteableView(ConfigBeanProxy readView) { this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView(); this.defaultView = bean.createProxy(); changedAttributes = new HashMap<String, PropertyChangeEvent>(); changedCollections = new HashMap<String, ProtectedList>(); }
@Override public ConfigBeanProxy handleExtension(Object owner, Class ownerType, Object[] params) { if (((Class) params[0]).getName().equals("com.sun.enterprise.config.serverbeans.SystemProperty")) return null; ConfigBeanProxy configExtension = null; List<ConfigBeanProxy> extensions = configModularityUtils.getExtensions(((ConfigBean) owner).createProxy(ownerType)); for (ConfigBeanProxy extension : extensions) { try { configExtension = (ConfigBeanProxy) ((Class) params[0]).cast(extension); return configExtension; } catch (Exception e) { // ignore, not the right type. } } try { ConfigBeanProxy pr = ((ConfigBean) owner).createProxy(ownerType); ConfigBeanProxy returnValue = moduleConfigurationLoader.createConfigBeanForType((Class) params[0], pr); return returnValue; } catch (TransactionFailure transactionFailure) { LogHelper.log(LOG, Level.INFO, "Cannot get extension type {0} for {1}.", transactionFailure, new Object[]{ owner.getClass().getName(), ownerType.getName()}); return null; } } }
public WriteableView(ConfigBeanProxy readView) { this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView(); this.defaultView = bean.createProxy(); changedAttributes = new HashMap<String, PropertyChangeEvent>(); changedCollections = new HashMap<String, ProtectedList>();
public WriteableView(ConfigBeanProxy readView) { this.bean = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(readView)).getMasterView(); this.defaultView = bean.createProxy(); changedAttributes = new HashMap<String, PropertyChangeEvent>(); changedCollections = new HashMap<String, ProtectedList>();
public static ConfigBeanProxy deepCopy(ConfigBeanProxy self, ConfigBeanProxy parent) throws TransactionFailure { ConfigBean configBean = (ConfigBean) Dom.unwrap(self); // ensure the parent is locked Transaction t = Transaction.getTransaction(parent); if (t==null) { throw new TransactionFailure("Must use a locked parent config object for copying new config object"); } ConfigBean copy = configBean.copy(configBean.parent()); return t.enroll(copy.createProxy()); }
public static ConfigBeanProxy deepCopy(ConfigBeanProxy self, ConfigBeanProxy parent) throws TransactionFailure { ConfigBean configBean = (ConfigBean) Dom.unwrap(self); // ensure the parent is locked Transaction t = Transaction.getTransaction(parent); if (t==null) { throw new TransactionFailure("Must use a locked parent config object for copying new config object"); } ConfigBean copy = configBean.copy(configBean.parent()); return t.enroll(copy.createProxy()); }
public static ConfigBeanProxy deepCopy(ConfigBeanProxy self, ConfigBeanProxy parent) throws TransactionFailure { ConfigBean configBean = (ConfigBean) Dom.unwrap(self); // ensure the parent is locked Transaction t = Transaction.getTransaction(parent); if (t==null) { throw new TransactionFailure("Must use a locked parent config object for copying new config object"); } ConfigBean copy = configBean.copy(configBean.parent()); return t.enroll(copy.createProxy()); }
public static ConfigBeanProxy deepCopy(ConfigBeanProxy self, ConfigBeanProxy parent) throws TransactionFailure { ConfigBean configBean = (ConfigBean) Dom.unwrap(self); // ensure the parent is locked Transaction t = Transaction.getTransaction(parent); if (t==null) { throw new TransactionFailure("Must use a locked parent config object for copying new config object"); } ConfigBean copy = configBean.copy(configBean.parent()); return t.enroll(copy.createProxy()); }
ConfigBeanProxy parentProxy = child.parent().createProxy(); ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() { @Override
public Transaction prepareAppConfigChanges(final DeploymentContext context) throws TransactionFailure { final Properties appProps = context.getAppProps(); final DeployCommandParameters deployParams = context.getCommandParameters(DeployCommandParameters.class); Transaction t = new Transaction(); try { // prepare the application element ConfigBean newBean = ((ConfigBean)ConfigBean.unwrap(applications)).allocate(Application.class); Application app = newBean.createProxy(); Application app_w = t.enroll(app); setInitialAppAttributes(app_w, deployParams, appProps, context); context.addTransientAppMetaData(ServerTags.APPLICATION, app_w); } catch(TransactionFailure e) { t.rollback(); throw e; } catch (Exception e) { t.rollback(); throw new TransactionFailure(e.getMessage(), e); } return t; }
public Transaction prepareAppConfigChanges(final DeploymentContext context) throws TransactionFailure { final Properties appProps = context.getAppProps(); final DeployCommandParameters deployParams = context.getCommandParameters(DeployCommandParameters.class); Transaction t = new Transaction(); try { // prepare the application element ConfigBean newBean = ((ConfigBean)ConfigBean.unwrap(applications)).allocate(Application.class); Application app = newBean.createProxy(); Application app_w = t.enroll(app); setInitialAppAttributes(app_w, deployParams, appProps, context); context.addTransientAppMetaData(ServerTags.APPLICATION, app_w); } catch(TransactionFailure e) { t.rollback(); throw e; } catch (Exception e) { t.rollback(); throw new TransactionFailure(e.getMessage(), e); } return t; }