/** * 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 properly constructed configuration object */ public ConfigBean allocate(Class<?> type) { return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(type)); }
/** * Executes some logic on some config beans protected by a transaction. * * @param code code to execute * @param objects config beans participating to the transaction * @return list of property change events * @throws TransactionFailure when the code did run successfully due to a * transaction exception */ public static Object apply(ConfigCode code, ConfigBeanProxy... objects) throws TransactionFailure { ConfigBean source = (ConfigBean) ConfigBean.unwrap(objects[0]); return source.getHabitat().<ConfigSupport>getService(ConfigSupport.class)._apply(code, objects); }
throws TransactionFailure { return parent.getHabitat().<ConfigSupport>getService(ConfigSupport.class). _createAndSet(parent, childType, attributes, runnable);
((WriteableView) t).getMasterView().getHabitat().<Transactions>getService(Transactions.class).addTransaction(transactionChanges); break;
/** * 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 * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(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 properly constructed configuration object */ public ConfigBean allocate(Class<?> type) { return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(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 properly constructed configuration object */ public ConfigBean allocate(Class<?> type) { return (ConfigBean) document.make(getHabitat(), null, this, document.buildModel(type)); }
public Object run(final ConfigBeanProxy... params) throws PropertyVetoException, TransactionFailure { if (params.length != 1) { throw new IllegalArgumentException(); } final ConfigBeanProxy parent = params[0]; final ConfigBean source = (ConfigBean) ConfigBean.unwrap(parent); final ConfigSupport configSupport = source.getHabitat().getService(ConfigSupport.class); return _run(parent, configSupport); }
/** * Executes some logic on some config beans protected by a transaction. * * @param code code to execute * @param objects config beans participating to the transaction * @return list of property change events * @throws TransactionFailure when the code did run successfully due to a * transaction exception */ public static Object apply(ConfigCode code, ConfigBeanProxy... objects) throws TransactionFailure { ConfigBean source = (ConfigBean) ConfigBean.unwrap(objects[0]); return source.getHabitat().<ConfigSupport>getService(ConfigSupport.class)._apply(code, objects); }
/** * Executes some logic on some config beans protected by a transaction. * * @param code code to execute * @param objects config beans participating to the transaction * @return list of property change events * @throws TransactionFailure when the code did run successfully due to a * transaction exception */ public static Object apply(ConfigCode code, ConfigBeanProxy... objects) throws TransactionFailure { ConfigBean source = (ConfigBean) ConfigBean.unwrap(objects[0]); return source.getHabitat().<ConfigSupport>getService(ConfigSupport.class)._apply(code, objects); }
/** * Executes some logic on some config beans protected by a transaction. * * @param code code to execute * @param objects config beans participating to the transaction * @return list of property change events * @throws TransactionFailure when the code did run successfully due to a * transaction exception */ public static Object apply(ConfigCode code, ConfigBeanProxy... objects) throws TransactionFailure { ConfigBean source = (ConfigBean) ConfigBean.unwrap(objects[0]); return source.getHabitat().getComponent(ConfigSupport.class)._apply(code, objects); }
/** * Executes some logic on some config beans protected by a transaction. * * @param code code to execute * @param objects config beans participating to the transaction * @return list of property change events * @throws TransactionFailure when the code did run successfully due to a * transaction exception */ public static Object apply(ConfigCode code, ConfigBeanProxy... objects) throws TransactionFailure { ConfigBean source = (ConfigBean) ConfigBean.unwrap(objects[0]); return source.getHabitat().getComponent(ConfigSupport.class)._apply(code, objects); }
public static Map<String, String> updateLoggingProperties(Config c, Map<String, String> properties) { ConfigBean cb = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getService(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); Map<String, String> map = new HashMap<String, String>(); try { map = loggingConfig.updateLoggingProperties(properties); } catch (IOException ex) { } return map; }
public static Map<String, String>getLoggingProperties(Config c) { ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); Map <String, String> map = new HashMap<String, String>() ; try { map = loggingConfig.getLoggingProperties(); } catch (IOException ex){ } return map; }
public static Map<String, String>updateLoggingProperties(Config c, Map<String, String>properties){ ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); Map <String, String> map = new HashMap<String, String>() ; try { map = loggingConfig.updateLoggingProperties(properties); } catch (IOException ex){ } return map; }
public static Map<String, String> getLoggingProperties(Config c) { ConfigBean cb = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getService(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); Map<String, String> map = new HashMap<String, String>(); try { map = loggingConfig.getLoggingProperties(); } catch (IOException ex) { } return map; }
public static String setLoggingProperty(Config c, String property, String value){ ConfigBean cb = (ConfigBean) ((ConfigView)Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getComponent(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); String prop = null; try{ prop= loggingConfig.setLoggingProperty(property, value); } catch (IOException ex){ } return prop; }
public static String setLoggingProperty(Config c, String property, String value) { ConfigBean cb = (ConfigBean) ((ConfigView) Proxy.getInvocationHandler(c)).getMasterView(); ServerEnvironmentImpl env = cb.getHabitat().getService(ServerEnvironmentImpl.class); LoggingConfigImpl loggingConfig = new LoggingConfigImpl(); loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath()); String prop = null; try { prop = loggingConfig.setLoggingProperty(property, value); } catch (IOException ex) { } return prop; }
/** * 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 * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().getComponent(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(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 * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }