From ab8d2859687e8183835900239c34a937d2feb54e Mon Sep 17 00:00:00 2001 From: David BRASSELY Date: Tue, 3 Sep 2013 14:04:55 +0200 Subject: [PATCH] ESBCOMP-63 Add support for application variable --- .../openesb/pojose/api/res/Context.java | 2 + .../openesb/pojose/res/impl/ContextImpl.java | 18 +- .../pojose/jbi/PojoSEConfiguration.java | 312 +++++++++++++++++- .../pojose/jbi/PojoSEConfigurationMBean.java | 62 +++- .../openesb/pojose/jbi/PojoSELifeCycle.java | 17 +- .../openesb/pojose/jbi/msgs.properties | 48 +++ .../openesb/pojose/jbi/thread/InMsgTask.java | 4 +- ojc-core/pojose/packaging/src/jbi.xml | 6 + 8 files changed, 459 insertions(+), 10 deletions(-) diff --git a/ojc-core/pojose/api/src/org/glassfish/openesb/pojose/api/res/Context.java b/ojc-core/pojose/api/src/org/glassfish/openesb/pojose/api/res/Context.java index eae1be338..6fb2cad35 100755 --- a/ojc-core/pojose/api/src/org/glassfish/openesb/pojose/api/res/Context.java +++ b/ojc-core/pojose/api/src/org/glassfish/openesb/pojose/api/res/Context.java @@ -227,4 +227,6 @@ public interface Context { * @return FaultMessage */ public FaultMessage createFaultMessage(Source payload, QName faultMsgType); + + public String getApplicationVariable(String applicationVariableName); } diff --git a/ojc-core/pojose/core/src/org/glassfish/openesb/pojose/res/impl/ContextImpl.java b/ojc-core/pojose/core/src/org/glassfish/openesb/pojose/res/impl/ContextImpl.java index 7270c31df..6bf446528 100755 --- a/ojc-core/pojose/core/src/org/glassfish/openesb/pojose/res/impl/ContextImpl.java +++ b/ojc-core/pojose/core/src/org/glassfish/openesb/pojose/res/impl/ContextImpl.java @@ -30,6 +30,7 @@ package org.glassfish.openesb.pojose.res.impl; import com.sun.jbi.common.qos.messaging.MessagingChannel; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.jbi.JBIException; @@ -59,12 +60,15 @@ public class ContextImpl implements Context{ private MessagingChannel dc = null; private ComponentContext cc = null; private CallTracker ct = null; + private Map applicationVariables; + private static final String LoggerName = "org.glassfish.openesb.pojose.jbi.nmr.BasePojoExecutor" ; //NOI18N - public ContextImpl(ComponentContext ncc, MessagingChannel ndc, CallTracker callt) { + public ContextImpl(ComponentContext ncc, MessagingChannel ndc, CallTracker callt, Map applicationVariables) { this.cc = ncc; this.dc = ndc; this.ct = callt; + this.applicationVariables = applicationVariables; } public void setMessageExchange(MessageExchange me) { @@ -229,6 +233,16 @@ public class ContextImpl implements Context{ return fm; } - + public String getApplicationVariable(String applicationVariableName) { + String [] metadatas = (String []) this.applicationVariables.get(applicationVariableName); + + if (metadatas != null) { + // IDX 0 = value & IDX 1 = type + return metadatas[0]; + } + + return null; + } + // *** End of Context Interface methods... } diff --git a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfiguration.java b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfiguration.java index eb2ecf41d..2b1989e90 100755 --- a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfiguration.java +++ b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfiguration.java @@ -32,16 +32,38 @@ package org.glassfish.openesb.pojose.jbi; import com.sun.jbi.common.qos.config.AbstractConfigMBean; import com.sun.jbi.common.qos.config.ComponentConfig; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; +import java.util.logging.Level; import java.util.logging.Logger; import javax.jbi.component.ComponentContext; import javax.jbi.management.DeploymentException; import javax.management.AttributeChangeNotification; +import javax.management.InvalidAttributeValueException; import javax.management.ListenerNotFoundException; +import javax.management.MBeanException; import javax.management.MBeanNotificationInfo; import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; import javax.management.NotificationFilter; import javax.management.NotificationListener; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.CompositeDataSupport; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.OpenType; +import javax.management.openmbean.SimpleType; +import javax.management.openmbean.TabularData; +import javax.management.openmbean.TabularDataSupport; +import javax.management.openmbean.TabularType; /** * @@ -50,11 +72,43 @@ import javax.management.NotificationListener; public class PojoSEConfiguration extends AbstractConfigMBean implements PojoSEConfigurationMBean { + /* + * 201-230 + */ + private static final Logger logger = Logger.getLogger(PojoSEConfiguration.class.getName()); + + private ComponentContext ctx; + private NotificationBroadcasterSupport broadcasterSupport = new NotificationBroadcasterSupport(); + // Configuration file name for environment variables + private static final String PERSIST_APPLICATION_VARIABLE_CONFIG_FILE_NAME = "ApplicationVariables.properties"; + + // Application variables row fields + private static final String APPLICATION_VARIABLES_ROW_KEY = "name"; + private static final String APPLICATION_VARIABLES_VALUE_FIELD = "value"; + private static final String APPLICATION_VARIABLES_TYPE_FIELD = "type"; + + // Global application configurations + private Map mAppVarMap; + private CompositeType mAppVarRowType = null; + private TabularType mAppVarTabularType = null; + public PojoSEConfiguration(ComponentContext ctx, ComponentConfig config) throws DeploymentException { super(ctx, config); + + this.ctx = ctx; + + try { + mAppVarMap = loadApplicationVariablesConfig(ctx.getWorkspaceRoot()); + mAppVarRowType = createApplicationVariableCompositeType(); + mAppVarTabularType = createApplicationVariableTabularType(); + } catch (Exception e) { + String msg = I18n.loc("POJOSE-7523: Failed during mbean initialization {0}", e); + logger.severe(msg); + throw new DeploymentException(msg, e); + } } public Integer getCoreThreadPoolSize() { @@ -166,6 +220,262 @@ public class PojoSEConfiguration extends AbstractConfigMBean public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException{ broadcasterSupport.removeNotificationListener(listener, filter, handback); - } + } + + private Map loadApplicationVariablesConfig(String workspaceRoot) throws MBeanException { + Properties persistedConfig = new Properties(); + Map appVarMap = new HashMap(); + + File appVarPersistFileName = new File(workspaceRoot, PERSIST_APPLICATION_VARIABLE_CONFIG_FILE_NAME); + if (!appVarPersistFileName.exists()) { + return appVarMap; + } + + try { + InputStream is = new FileInputStream(appVarPersistFileName); + persistedConfig.load(is); + is.close(); + + // load the persisted environment variable configurations in the map + for (Enumeration e = persistedConfig.propertyNames(); e.hasMoreElements(); ) { + String name = (String) e.nextElement(); + String metadata = persistedConfig.getProperty(name); + int startIndex = metadata.indexOf("{"); + String value = (startIndex == 0)? null : metadata.substring(0, startIndex); + String type = metadata.substring(startIndex + 1, metadata.length() -1); + appVarMap.put(name, new String[] {value, type}); + } + } catch (Exception ex) { + String msg = I18n.loc("POJOSE-7539: Failed to load application variables {0} {1}", PERSIST_APPLICATION_VARIABLE_CONFIG_FILE_NAME, ex); + logger.severe(msg); + throw new MBeanException(ex, msg); + } + + return appVarMap; + } + + private CompositeType createApplicationVariableCompositeType() throws OpenDataException { + if (mAppVarRowType != null) { + return mAppVarRowType; + } + + String[] appVarRowAttrNames = { APPLICATION_VARIABLES_ROW_KEY, APPLICATION_VARIABLES_VALUE_FIELD, APPLICATION_VARIABLES_TYPE_FIELD }; + String[] appVarRowAttrDesc = { "Application Variable Name", "Application Variable Value", "Application Variable Type" }; + OpenType[] appVarRowAttrTypes = { SimpleType.STRING, SimpleType.STRING, SimpleType.STRING }; + + mAppVarRowType = new CompositeType("ApplicationVariables", + "Application Variable Composite Data", + appVarRowAttrNames, + appVarRowAttrDesc, + appVarRowAttrTypes); + + return mAppVarRowType; + } + + private TabularType createApplicationVariableTabularType() throws OpenDataException { + if (mAppVarTabularType != null) { + return mAppVarTabularType; + } + + if (mAppVarRowType == null) { + mAppVarRowType = createApplicationVariableCompositeType(); + } + + mAppVarTabularType = new TabularType("ApplicationVariableList", + "List of Application Variables", + mAppVarRowType, + new String[] { APPLICATION_VARIABLES_ROW_KEY } ); + + return mAppVarTabularType; + } + + /** + * This operation adds a new application variable. If a variable with the same name + * already exists, the operation fails. + * + * @param name - name of the application variable + * @param appVar - this is the application variable compoiste + * @throws MBeanException if an error occurs in adding the application variable to the + * component. + */ + public void addApplicationVariable(String name, CompositeData appVar) throws InvalidAttributeValueException, MBeanException { + if (mAppVarMap.containsKey(name)) { + String msg = I18n.loc("POJOSE-7524: Application variable name already exists {0}", name); + logger.severe(msg); + throw new MBeanException(new Exception(msg)); + } + + CompositeType rowType = appVar.getCompositeType(); + if (rowType.keySet().size() != 3) { + String msg = I18n.loc("POJOSE-7525: Invalid item size for app variable {0}", rowType.keySet().size()); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + if (!appVar.containsKey(APPLICATION_VARIABLES_ROW_KEY)) { + String msg = I18n.loc("POJOSE-7526: Invalid key for composite data for app variable {0}", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + String appVarValue = (String)appVar.get(APPLICATION_VARIABLES_VALUE_FIELD); + String appVarType = (String)appVar.get(APPLICATION_VARIABLES_TYPE_FIELD); + + if (appVarValue == null) { + String msg = I18n.loc("POJOSE-7527: Invalid app variable composite data no value field {0}", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + if (appVarType == null) { + String msg = I18n.loc("POJOSE-7528: Invalid app variable composite data no type field", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + mAppVarMap.put(name, new String[] { appVarValue, appVarType }); + + if (logger.isLoggable(Level.FINEST)) { + String msg = I18n.loc("POJOSE-7529: New application variable added {0} {1}", name, appVarValue); + logger.finest(msg); + } + + persistApplicationVariablesConfig(); + } + + /** + * This operation sets an application variable. If a variable does not exist with + * the same name, its an error. + * + * @param name - name of the application variable + * @param appVar - this is the application variable compoiste to be updated. + * @throws MBeanException if one or more application variables cannot be deleted + */ + public void setApplicationVariable(String name, CompositeData appVar) throws InvalidAttributeValueException, MBeanException { + if (!mAppVarMap.containsKey(name)) { + String msg = I18n.loc("POJOSE-7530: Application variable does not exist for set {0}", name); + logger.severe(msg); + throw new MBeanException(new Exception(msg)); + } + + CompositeType rowType = appVar.getCompositeType(); + if (rowType.keySet().size() != 3) { + String msg = I18n.loc("POJOSE-7531: Invalid item size for app variable", rowType.keySet().size()); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + if (!appVar.containsKey(APPLICATION_VARIABLES_ROW_KEY)) { + String msg = I18n.loc("POJOSE-7526: Invalid key for composite data for app variable {0}", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + String appVarValue = (String)appVar.get(APPLICATION_VARIABLES_VALUE_FIELD); + String appVarType = (String)appVar.get(APPLICATION_VARIABLES_TYPE_FIELD); + + if (appVarValue == null) { + String msg = I18n.loc("POJOSE-7527: Invalid app variable composite data no value field {0}", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + if (appVarType == null) { + String msg = I18n.loc("POJOSE-7534: Invalid app variable composite data no type field {0}", name); + logger.severe(msg); + throw new InvalidAttributeValueException(msg); + } + + mAppVarMap.put(name, new String[] { appVarValue, appVarType }); + + if (logger.isLoggable(Level.FINEST)) { + String msg = I18n.loc("POJOSE-7535: Application variable updated {0} {1}", name, appVarValue ); + logger.finest(msg); + } + + // persist the application variable properties + persistApplicationVariablesConfig(); + } + + /** + * This operation deletes an application variable, if a variable with the specified name does + * not exist, it's an error. + * + * @param name - name of the application variable + * @throws MBeanException on errors. + */ + public void deleteApplicationVariable(String name) throws MBeanException { + if (!mAppVarMap.containsKey(name)) { + String msg = I18n.loc("POJOSE-7536: Application variable does not exist for delete {0}", name); + logger.severe(msg); + throw new MBeanException(new Exception(msg)); + } + + mAppVarMap.remove(name); + + if (logger.isLoggable(Level.FINEST)) { + String msg = I18n.loc("POJOSE-7537: Application variable deleted {0}", name); + logger.finest(msg); + } + + persistApplicationVariablesConfig(); + } + + public TabularData getApplicationVariables() { + TabularData tabularData = new TabularDataSupport(mAppVarTabularType); + for (Iterator iter = mAppVarMap.keySet().iterator(); iter.hasNext(); ) { + String name = (String) iter.next(); + String[] metadata = (String[]) mAppVarMap.get(name); + String value = metadata [0]; + String type = metadata [1]; + Object[] data = ("PASSWORD".equalsIgnoreCase(type) && value != null && !"".equals(value))? + new Object[] { name, "*******", type } : new Object[] {name, value, type}; + try { + CompositeData rowData = new CompositeDataSupport(mAppVarRowType, + new String[] { APPLICATION_VARIABLES_ROW_KEY , + APPLICATION_VARIABLES_VALUE_FIELD , + APPLICATION_VARIABLES_TYPE_FIELD }, + data); + + tabularData.put(rowData); + } catch (OpenDataException e) { + String msg = I18n.loc("POJOSE-7538: Unable to construct composite data for app variable", e); + logger.severe(msg); + throw new RuntimeException(msg); + } + } + + return tabularData; + } + + public Map retrieveApplicationVariablesMap() { + return mAppVarMap; + } + + public void updateApplicationVariablesMap(Map appVarMap) throws MBeanException { + mAppVarMap = appVarMap; + persistApplicationVariablesConfig(); + } + + private void persistApplicationVariablesConfig() throws MBeanException { + // Persist the changed configuration + try { + File appVarPersistFileName = new File(ctx.getWorkspaceRoot(), PERSIST_APPLICATION_VARIABLE_CONFIG_FILE_NAME); + OutputStream os = new FileOutputStream(appVarPersistFileName); + for (Iterator iter = mAppVarMap.keySet().iterator(); iter.hasNext(); ) { + String key = (String) iter.next(); + String[] metadata = (String[]) mAppVarMap.get(key); + String value = metadata[0]; + String type = metadata[1]; + String prop = (value != null)? key + "=" + value + "{" + type + "}\n" : key + "={" + type + "}\n"; + os.write(prop.getBytes()); + } + os.close(); + } catch (Exception ex) { + String msg = I18n.loc("POJOSE-7540: Failed to persist application variables {0} {1}", PERSIST_APPLICATION_VARIABLE_CONFIG_FILE_NAME, ex); + logger.severe(msg); + throw new MBeanException(ex, msg); + } + } } diff --git a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfigurationMBean.java b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfigurationMBean.java index 7c31b03f0..2865c8335 100755 --- a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfigurationMBean.java +++ b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSEConfigurationMBean.java @@ -30,7 +30,12 @@ package org.glassfish.openesb.pojose.jbi; +import java.util.Map; +import javax.management.InvalidAttributeValueException; +import javax.management.MBeanException; import javax.management.NotificationEmitter; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.TabularData; /** @@ -38,7 +43,7 @@ import javax.management.NotificationEmitter; * * @author Girish Patil */ -public interface PojoSEConfigurationMBean extends NotificationEmitter{ +public interface PojoSEConfigurationMBean extends NotificationEmitter { public static final String CORE_THREAD_POOL_SIZE = "CoreThreadPoolSize"; //NOI18N public static final String MAX_THREAD_POOL_SIZE = "MaxThreadPoolSize"; //NOI18N public static final String THREAD_POOL_BLOCKING_QUEUE_SIZE = "ThreadPoolBlockingQueueSize"; //NOI18N @@ -62,4 +67,59 @@ public interface PojoSEConfigurationMBean extends NotificationEmitter{ */ public Integer getThreadPoolBlockingQueueSize(); public void setThreadPoolBlockingQueueSize(Integer cz); + + /** + * This operation adds a new application variable. If a variable with the same name + * already exists, the operation fails. + * + * @param name - name of the application variable + * @param appVar - this is the application variable compoiste + * @throws MBeanException if an error occurs in adding the application variable to the + * component. + */ + public void addApplicationVariable(String name, CompositeData appVar) throws InvalidAttributeValueException, MBeanException; + + /** + * This operation sets an application variable. If a variable does not exist with + * the same name, its an error. + * + * @param name - name of the application variable + * @param appVar - this is the application variable compoiste to be updated. + * @throws MBeanException if one or more application variables cannot be deleted + */ + public void setApplicationVariable(String name, CompositeData appVar) throws InvalidAttributeValueException, MBeanException; + + /** + * This operation deletes an application variable, if a variable with the specified name does + * not exist, it's an error. + * + * @param name - name of the application variable + * @throws MBeanException on errors. + */ + public void deleteApplicationVariable(String name) throws MBeanException; + + /** + * Get the Application Variable set for a component. + * + * @return a TabularData which has all the applicationvariables set on the component. + */ + public TabularData getApplicationVariables(); + + /** Retrieves the application variables map. The map key is the application + * variable name, the value is a String[] containing detailed information + * about the application variable. This method is used to communicate + * application variable data with in the component and is not intended + * for MBean clients + * + * @return a Map containing application variable information + */ + public Map retrieveApplicationVariablesMap(); + + /** Updates the application variable map. + * This method is used to communicate application configuration data within the component, and + * not intended for MBean clients + * + * @param a Map containing application variable information + */ + public void updateApplicationVariablesMap(Map val) throws MBeanException; } diff --git a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSELifeCycle.java b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSELifeCycle.java index 162b3de3d..d0fddeb67 100755 --- a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSELifeCycle.java +++ b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/PojoSELifeCycle.java @@ -34,11 +34,13 @@ import com.sun.jbi.common.qos.config.ConfigPersistence; import com.sun.jbi.common.qos.config.RuntimeConfigurationMBean; import com.sun.jbi.common.util.MBeanHelper; import com.sun.jbi.common.util.Util; +import com.sun.jbi.configuration.RuntimeConfigurationHelper; import java.util.logging.Level; import java.util.logging.Logger; import javax.jbi.JBIException; import javax.jbi.component.ComponentContext; import javax.jbi.component.ComponentLifeCycle; +import javax.jbi.management.MBeanNames; import javax.jbi.messaging.DeliveryChannel; import javax.management.ObjectName; @@ -50,7 +52,8 @@ public class PojoSELifeCycle implements ComponentLifeCycle { private POJOComponentContext pojoCompCtx; private Logger compLifeCycleLogger; private ComponentConfig compCfg; - private MBeanHelper mbeanHelper; + //private MBeanHelper mbeanHelper; + private RuntimeConfigurationHelper mRuntimeConfigHelper; public PojoSELifeCycle(POJOComponentContext pc){ assert pc != null; @@ -67,9 +70,15 @@ public class PojoSELifeCycle implements ComponentLifeCycle { ConfigPersistence.loadConfig(compCfg, ctx.getWorkspaceRoot()); PojoSEConfigurationMBean cfgMbean = new PojoSEConfiguration(ctx, compCfg); - mbeanHelper = new MBeanHelper(ctx); - mbeanHelper.registerMBean(RuntimeConfigurationMBean.CONFIGURATION_EXTENSION, cfgMbean); - + try { + MBeanNames mbeanNames = ctx.getMBeanNames(); + ObjectName runtimeConfigMBeanObjName = mbeanNames.createCustomComponentMBeanName("Configuration"); + mRuntimeConfigHelper = new RuntimeConfigurationHelper(runtimeConfigMBeanObjName, ctx.getMBeanServer()); + mRuntimeConfigHelper.registerMBean(cfgMbean); + } catch (Exception e) { + throw new JBIException(e); + } + pojoCompCtx.setConfigMbean(cfgMbean); // send alert diff --git a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/msgs.properties b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/msgs.properties index 59ec284d0..7e99a51d0 100755 --- a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/msgs.properties +++ b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/msgs.properties @@ -218,3 +218,51 @@ POJOSE-7521 = Exception while persisting configuration changes. {0} # org.glassfish.openesb.pojose.jbi.thread.InboundProcessor POJOSE-7522 = Exception while executing for ME {0}. {1} +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7523 = Failed during mbean initialization {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7524 = Application variable name already exists {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7525 = Invalid item size for app variable {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7526 = Invalid key for composite data for app variable {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7527 = Invalid app variable composite data no value field {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7528 = Invalid app variable composite data no type field + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7529 = New application variable added {0} {1} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7530 = Application variable does not exist for set {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7531 = Invalid item size for app variable + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7534 = Invalid app variable composite data no type field {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7535 = Application variable updated {0} {1} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7536 = Application variable does not exist for delete {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7537 = Application variable deleted {0} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7538 = Unable to construct composite data for app variable + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7539 = Failed to load application variables {0} {1} + +# org.glassfish.openesb.pojose.jbi.PojoSEConfiguration +POJOSE-7540 = Failed to persist application variables {0} {1} + diff --git a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/thread/InMsgTask.java b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/thread/InMsgTask.java index ef065958e..3c9d20b61 100755 --- a/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/thread/InMsgTask.java +++ b/ojc-core/pojose/jbiadapter/src/org/glassfish/openesb/pojose/jbi/thread/InMsgTask.java @@ -234,13 +234,13 @@ public class InMsgTask extends BaseTask { if (exp == null){ if (pojoMeta.getProvider() != null){ // Using current @Provider annotation. - ContextImpl ctximpl = new ContextImpl(ctx.getJBIComponentContext(), ctx.getDC(), (CallTracker)this.pt); + ContextImpl ctximpl = new ContextImpl(ctx.getJBIComponentContext(), ctx.getDC(), (CallTracker)this.pt, ctx.getConfigMbean().retrieveApplicationVariablesMap()); ctximpl.setMessageExchange(me); POJOAnnotationProcessor.injectFields(pojoMeta, pojoObj, ctximpl, (CallTracker)this.pt); } else { // Using old @POJO annotation. - ContextImpl ctximpl = new ContextImpl(ctx.getJBIComponentContext(), ctx.getDC(), (CallTracker)this.pt); + ContextImpl ctximpl = new ContextImpl(ctx.getJBIComponentContext(), ctx.getDC(), (CallTracker)this.pt, ctx.getConfigMbean().retrieveApplicationVariablesMap()); ctximpl.setMessageExchange(me); POJOContextImpl pjctx = new POJOContextImpl(ctx.getJBIComponentContext(), ctx.getDC()); diff --git a/ojc-core/pojose/packaging/src/jbi.xml b/ojc-core/pojose/packaging/src/jbi.xml index a43e03cef..524b40df6 100755 --- a/ojc-core/pojose/packaging/src/jbi.xml +++ b/ojc-core/pojose/packaging/src/jbi.xml @@ -74,6 +74,12 @@ + + + + + +