According to http://tomee.apache.org/containers-and-resources.html for stateless beans the max poolsize can be set as a property within
<Container id="Foo" type="STATELESS">
</Container>
I need to know how ID attribute is related to the server instance. Can I use any name instead of "Foo"? If not, where do I declare Foo?
Id is really the name of the container. You can define multiple and bind a container to an EJB through openejb-jar.xml if desired but if there is only one it is the global container for all EJB.
Value is not important.
Related
If you use IOptions pattern i.e typed settings approach how should you then be able to have a dynamic name convention for parameters in App Configuration (AC) ? Let's say we have 3 environments test, stage and prod and in AC we would like to have a name convention for parameters as:
<environment>:<application name>:<param name>
Is that possible to achieve due to when I have tested there seems to be some "behind the scene" mapping based IOptions entity name and appsettings.json structure or can I override this this behavior to achieve a more dynamic param name convention based on Env parameters as (test|stage|prod), Env parameter for service name and a more generic name convention in IOptions entity/appsettings files for all parameters that should be centrally/dynamically stored
Thanks!
The naming convention you plan to use will work, however, I would recommend naming config keys like below and use labels in AC for environments.
<application name>:<param name>
For example,
Key
Value
Label
app1:settings:debug
true
dev
app1:settings:debug
true
stage
app2:settings:color
yellow
test
Your application then can load only the configuration that is relevant to it (app1 vs. app2) and for the environment where it runs (dev/state/test etc.) by using key filters and label filters. You can find more details of this discussion in https://learn.microsoft.com/en-us/azure/azure-app-configuration/concept-key-value.
Here is a tutorial that shows how to use IOptions with App Configuration in an ASP.NET Core app:
https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-aspnet-core
We are using ejb-jar.xml to configure the MDB as mentioned below. We need to access one of the activation config property "subscriptionName" in MDB.
<message-driven>
<ejb-name>InboundListener</ejb-name>
<!--Class whose MDB instance with above name will be created by EJB container-->
<ejb-class>com.xyz.listener.InboundListener</ejb-class>
<activation-config>
<activation-config-property>
<!--The type of JMS resource this instance will be accessing-->
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Topic</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>subscriptionName</activation-config-property-name>
<activation-config-property-value>OXI145937</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
How to get the value of subscriptionName property in MDB's onMessage() method.
Appreciate your help and time.
I'm using RHQ JMX plugin to get operations and attributes of one custom Mbean.
It is working but I would like to add the possibility to update an attribute value and I can't use the setter function to update it as it's not recognized as an operation.
How can I update my plugin to add this possibility ?
If you're writing your own plugin, you can declare the bean attribute as a:
measurement, to get history of values
resource configuration property, to easily update the value from RHQ
Declaring an int MBean attribue in resource configuration works as follow:
<resource-configuration>
<c:simple-property name="MyAttributeName" type="integer"/>
</resource-configuration>
I am trying to pass a variable to a Spring bean like so:
<component doc:name="Java">
<no-arguments-entry-point-resolver />
<prototype-object class="org.test.MyComponent">
<property key="fileName" value="#[sessionVars.filename]" />
</prototype-object>
</component>
But the expression never resolves? Is there a another way to do this?
This is a confusion with the spring configuration and Mule Expression language(MEL).
Point 1:
Even though the component is defined inside the Mule Config file. The elements (tags) <property/> is from the Springs Bean schema definition. So the attribute values of key and value are not interpreted by the MEL.
Point 2: As it is provided as setter injection which is invoked during loading(instantiation) the value of session variable(run time value) will not be available.
One possible solution to this would be to make the component implement Callable interface of Mule. So that you will have access to the MuleMessage which contains the session variable.
#Override
public Object onCall(MuleEventContext eventContext) throws Exception {
MuleMessage muleMessage = eventContext.getMessage();
muleMessage.getProperty("propertyName", PropertyScope.SESSION);
Hope this helps.
When the Mule server starts, each of the elements are loaded, and the component and spring-object are created. I don't think you can pass session variable or for that matter any variable other than context-properties to object creation happening at server start-up time.
If i can use
<td><textarea><bean:write name="smlMoverDetailForm" property="empFDJoiningDate"/>
</textarea></td>
to displace a value how can i use the struts tags to save a vaiable to the sesssion
in sudo code
session.setAttribute("test" , "<bean:write name="smlMoverDetailForm"
property="empFDJoiningDate"/>");
is this possible?
I don't think so.
Struts tags are only available in jsp pages.
But you can do something like this:
if the bean smlMoverDetailForm is in scope request
session.setAttribute("test",((THECLASSOFTHEBEAN)request.getAttribute("smlMoverDetailForm")).getEmpFDJoiningDate());
else if the bean smlMoverDetailForm is in scope session
session.setAttribute("test",((THECLASSOFTHEBEAN)request.getSession().getAttribute("smlMoverDetailForm")).getEmpFDJoiningDate());
Late but possible. You can set the session scope to your form bean in struts-config.xml file when you map the action.