[
https://issues.apache.org/jira/browse/MUSE-243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529485
]
Kam K. Yee commented on MUSE-243:
---------------------------------
Here are a few recommendations...
[1]
To make the resource type loading more configurable, we could include a boolean
attribute ("active-polling") to the "resource-type-loading" element which would
specify whether active polling and dynamic loading is desired at runtime. If
true, then a thread is spawn with the sleep interval specified by the element
"resource-type-loading-interval" (another newly suggested element). If false,
then the directories specified are only inspected for new resource types during
boot-up.
<xs:element name="directory" type="xs:string"/>
<xs:element name="resource-type-loading-class" type="xs:string"/>
<xs:element name="resource-type-loading-interval" type="xs:integer"/>
<xs:element name="directories">
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:directory" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="resource-type-loading">
<xs:attribute name="active-polling" type="xs:boolean" default="false"/>
<xs:complexType>
<xs:sequence>
<xs:element ref="tns:directories"/>
</xs:sequence>
<xs:element ref="tns:resource-type-loading-class"/>
<xs:element ref="tns:resource-type-loading-interval"/>
</xs:complexType>
</xs:element>
[2]
To make the threading more easily replaceable, we could define a new interface
(e.g., ResourceTypeLoaderPoller). This interface would define one method (e.g.,
initialize(). The deployer will use the new configuration element in the muse
schema ("resource-type-loading-class") for to specify the class implementing
this new interface.
As a "default" implementation provided with Muse, we would include two classes:
One class that implements Runnable (e.g., DirectoryPoller extends Runnable).
In the run() method of this class we implement all the logic necessary for
polling the directories of interest.
Another class which implements the new interface, which is the one that would
be listed as the "resource-type-loading-class" in the muse.xml, which creates a
new Thread passing in the Runnable implementation as the argument and
configures and manages this thread.
If others wanted to replace our Java thread implementation with, say, Work
threads, they could create their class which extends our Runnable (hence
inheriting the directory polling logic) and implements the Work interface.
> Dynamic discovery and aggregation of resource types
> ---------------------------------------------------
>
> Key: MUSE-243
> URL: https://issues.apache.org/jira/browse/MUSE-243
> Project: Muse
> Issue Type: New Feature
> Components: Core Engine - Resource and Capability APIs
> Reporter: Balan Subramanian
> Assignee: Dan Jemiolo
> Fix For: 2.3.0
>
> Attachments: muse-243 - Dynamic discovery and aggregation of resource
> types.pdf
>
>
> In some cases all resource type definitions are not available at the time the
> Muse runtime starts. So even though multiple resource types can be hosted by
> a single Muse instance, all the resource type definitions must be available
> before Muse starts and listed in muse.xml. It is desired that Muse be made
> dynamic so that it can monitor a particular folder where an archive (JAR for
> example) is dropped. This archive will contain the necessary classes,
> descriptors, router entries etc. and a muse.xml fragment which will be used
> by Muse to instantiate the specified instances of that resource type. As an
> additional enhancement, it is desired that in addition to support archive
> files, Muse supports this feature for OSGi bundles by registering with the
> OSGi container's bundle registry. This enhancement is applicable only when
> the runtime environment for Muse is OSGi.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]