<trolling-for-patch>The resolve() logic in dmr doesn't support
alternative properties the way the old jboss-common-core stuff
did.</trolling-for-patch>
Doesn't deal with System.getEnv() either. ;)
On 10/19/11 11:07 PM, Scott Stark wrote:
Yes, hopefully. We can have a multi-valued reference like the
following
that would allow for the env-vars openshift uses, system properties, as
well as defaults:
<datasource jndi-name="java:jboss/datasources/MysqlDS"
enabled="false"
use-java-context="true" pool-name="MysqlDS">
<connection-url>jdbc:mysql://${env.OPENSHIFT_DB_HOST,mysql.host:localhost}:${env.OPENSHIFT_DB_PORT,mysql.port:3306}/${env.OPENSHIFT_APP_NAME,mysql.dbname:test}</connection-url>
<driver>mysql</driver>
<security>
<user-name>admin</user-name>
<password>${env.OPENSHIFT_DB_PASSWORD,mysql.password:admin}</password>
</security>
</datasource>
I'll shoot something your way once I have it working.
On 10/18/11 11:07 PM, Max Rydahl Andersen wrote:
> hmm - with this we could actually end up having a shareable standalone.xml between
openshift and local that doesn't
> need any alterations.
>
> The trick is only to get agreement on what property/environment names it will use.
>
> Scott - once you got a standalone.xml that has these things in place could you share
it and i'll investigate how much
> work we would need to do to support launching AS7 locally with all those variables
present.
>
> p.s. system properties would be our recommended approach since messing with
environment variables and java launches
> have a history of being unreliable cross platform ;)
>
> /max
>
>
> On Oct 19, 2011, at 01:22, Brian Stansberry wrote:
>
>> On 10/18/11 5:34 PM, Scott Stark wrote:
>>> Thanks. I'll check against the attributes I'll need and raise issues
to
>>> address those I find missing.
>>>
>> Thanks; that will be very helpful.
>>
>>> One issue I see is that we are only looking to System.getProperty(name)
>>> for the value of an expression in the org.jboss.dmr.ExpressionValue
>>> class. The expressions I'm typically using need to be queried using
>>> System.getenv(name). Would it be ok to fallback to a System.getenv(name)
>>> if there is no System.getProperty(name) value found? This would require
>>> an update to the dmr project.
>>>
>> I'm fine with that.
>>
>>> On 10/18/11 1:35 PM, Brian Stansberry wrote:
>>>> See example below of reading a resource and then setting an attribute to
>>>> an expression value. This will work properly on master when I'm done
today.
>>>>
>>>> Note that not all attributes support expressions (most don't). For
those
>>>> that do, the :read-resource-description content for the attribute will
>>>> include:
>>>>
>>>> "expressions-allowed" => true
>>>>
>>>> [standalone@localhost:9999 /] cd subsystem=ejb3
>>>> [standalone@localhost:9999 subsystem=ejb3] :read-resource
>>>>
>>>> {
>>>> "outcome" => "success",
>>>> "result" => {
>>>> "default-mdb-instance-pool" =>
"mdb-strict-max-pool",
>>>> "default-resource-adapter-name" =>
"hornetq-ra",
>>>> "default-singleton-access-timeout" =>
5000L,
>>>> "default-slsb-instance-pool" =>
"slsb-strict-max-pool",
>>>> "default-stateful-access-timeout" => 5000,
>>>> "service" => {
>>>> "timer-service" => undefined,
>>>> "remote" => undefined,
>>>> "async" => undefined
>>>> },
>>>> "strict-max-bean-instance-pool" => {
>>>> "slsb-strict-max-pool" => undefined,
>>>> "mdb-strict-max-pool" => undefined
>>>> },
>>>> "thread-pool" => {"default" =>
undefined}
>>>> }
>>>> }
>>>> [standalone@localhost:9999 subsystem=ejb3]
>>>>
:write-attribute(name=default-stateful-access-timeout,value=${sfsb.timeout:5000})
>>>> {"outcome" => "success"}
>>>> [standalone@localhost:9999 subsystem=ejb3] :read-resource
>>>>
>>>> {
>>>> "outcome" => "success",
>>>> "result" => {
>>>> "default-mdb-instance-pool" =>
"mdb-strict-max-pool",
>>>> "default-resource-adapter-name" =>
"hornetq-ra",
>>>> "default-singleton-access-timeout" =>
5000L,
>>>> "default-slsb-instance-pool" =>
"slsb-strict-max-pool",
>>>> "default-stateful-access-timeout" =>
expression
>>>> "${sfsb.timeout:5000}",
>>>> "service" => {
>>>> "timer-service" => undefined,
>>>> "remote" => undefined,
>>>> "async" => undefined
>>>> },
>>>> "strict-max-bean-instance-pool" => {
>>>> "slsb-strict-max-pool" => undefined,
>>>> "mdb-strict-max-pool" => undefined
>>>> },
>>>> "thread-pool" => {"default" =>
undefined}
>>>> }
>>>> }
>>>>
>>>>
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> jboss-as7-dev(a)lists.jboss.org
>>>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>> --
>> Brian Stansberry
>> Principal Software Engineer
>> JBoss by Red Hat
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
> /max
>
http://about.me/maxandersen
>
>
>
>
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev