-Djboss.modules.system.pkgs=class1, class2 runtime equivalent

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

-Djboss.modules.system.pkgs=class1, class2 runtime equivalent

Sam Thomas
Hi guys!

When an agent starts up with the JVM (through premain()) we can specify in the command to start up jboss, classes to be added to jboss system packages by setting the above property.

I am looking to replicate the effect of setting that system property after jboss has started up, i.e, an agent will be loaded through agentmain() after jboss is up and running. 

All help is appreciated.

Thanks and Regards
Sam Thomas

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: -Djboss.modules.system.pkgs=class1, class2 runtime equivalent

David Lloyd-2
On Thu, Nov 15, 2018 at 8:38 AM Sam Thomas <[hidden email]> wrote:
> Hi guys!
>
> When an agent starts up with the JVM (through premain()) we can specify in the command to start up jboss, classes to be added to jboss system packages by setting the above property.
>
> I am looking to replicate the effect of setting that system property after jboss has started up, i.e, an agent will be loaded through agentmain() after jboss is up and running.

At present, these values are calculated when JBoss Modules starts up
and stored in a constant field.  So to change that exact mechanism
with one which can be reloaded would require that the field be made
mutable and that an operation be added which recomputes that field.
This is to say that it is possible, but the current code doesn't do
that.

--
- DML
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: -Djboss.modules.system.pkgs=class1, class2 runtime equivalent

Sam Thomas
Hi David, 

Can you point me to that field(the class as well) that stores these values? I assume just changing the value(after making the field mutable) to include additional classes isn’t going to be enough?

Thanks
./Sam

On Thu, Nov 15, 2018 at 8:22 PM David Lloyd <[hidden email]> wrote:
On Thu, Nov 15, 2018 at 8:38 AM Sam Thomas <[hidden email]> wrote:
> Hi guys!
>
> When an agent starts up with the JVM (through premain()) we can specify in the command to start up jboss, classes to be added to jboss system packages by setting the above property.
>
> I am looking to replicate the effect of setting that system property after jboss has started up, i.e, an agent will be loaded through agentmain() after jboss is up and running.

At present, these values are calculated when JBoss Modules starts up
and stored in a constant field.  So to change that exact mechanism
with one which can be reloaded would require that the field be made
mutable and that an operation be added which recomputes that field.
This is to say that it is possible, but the current code doesn't do
that.

--
- DML
--

Thanks
./Sam

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: -Djboss.modules.system.pkgs=class1, class2 runtime equivalent

David Lloyd-2
Have a look at the static initializer of the org.jboss.modules.Module
class.  If you extracted the computation of those two fields to a
method, and then made the fields volatile, you would be able to
re-call the method whenever you've updated the system property.

The fields are consulted on each class lookup so changes should take
effect immediately.
On Thu, Nov 15, 2018 at 10:57 AM Sam Thomas <[hidden email]> wrote:

>
> Hi David,
>
> Can you point me to that field(the class as well) that stores these values? I assume just changing the value(after making the field mutable) to include additional classes isn’t going to be enough?
>
> Thanks
> ./Sam
>
> On Thu, Nov 15, 2018 at 8:22 PM David Lloyd <[hidden email]> wrote:
>>
>> On Thu, Nov 15, 2018 at 8:38 AM Sam Thomas <[hidden email]> wrote:
>> > Hi guys!
>> >
>> > When an agent starts up with the JVM (through premain()) we can specify in the command to start up jboss, classes to be added to jboss system packages by setting the above property.
>> >
>> > I am looking to replicate the effect of setting that system property after jboss has started up, i.e, an agent will be loaded through agentmain() after jboss is up and running.
>>
>> At present, these values are calculated when JBoss Modules starts up
>> and stored in a constant field.  So to change that exact mechanism
>> with one which can be reloaded would require that the field be made
>> mutable and that an operation be added which recomputes that field.
>> This is to say that it is possible, but the current code doesn't do
>> that.
>>
>> --
>> - DML
>
> --
>
> Thanks
> ./Sam



--
- DML

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: -Djboss.modules.system.pkgs=class1, class2 runtime equivalent

Sam Thomas
Cool I will look it up and get back to you if I'm stuck. Thank you for your help David.

Thanks
./Sam


On Thu, Nov 15, 2018 at 10:55 PM David Lloyd <[hidden email]> wrote:
Have a look at the static initializer of the org.jboss.modules.Module
class.  If you extracted the computation of those two fields to a
method, and then made the fields volatile, you would be able to
re-call the method whenever you've updated the system property.

The fields are consulted on each class lookup so changes should take
effect immediately.
On Thu, Nov 15, 2018 at 10:57 AM Sam Thomas <[hidden email]> wrote:
>
> Hi David,
>
> Can you point me to that field(the class as well) that stores these values? I assume just changing the value(after making the field mutable) to include additional classes isn’t going to be enough?
>
> Thanks
> ./Sam
>
> On Thu, Nov 15, 2018 at 8:22 PM David Lloyd <[hidden email]> wrote:
>>
>> On Thu, Nov 15, 2018 at 8:38 AM Sam Thomas <[hidden email]> wrote:
>> > Hi guys!
>> >
>> > When an agent starts up with the JVM (through premain()) we can specify in the command to start up jboss, classes to be added to jboss system packages by setting the above property.
>> >
>> > I am looking to replicate the effect of setting that system property after jboss has started up, i.e, an agent will be loaded through agentmain() after jboss is up and running.
>>
>> At present, these values are calculated when JBoss Modules starts up
>> and stored in a constant field.  So to change that exact mechanism
>> with one which can be reloaded would require that the field be made
>> mutable and that an operation be added which recomputes that field.
>> This is to say that it is possible, but the current code doesn't do
>> that.
>>
>> --
>> - DML
>
> --
>
> Thanks
> ./Sam



--
- DML

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev