You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Adam Lally <al...@alum.rpi.edu> on 2007/03/13 22:50:34 UTC

Allowing custom service adapters to be plugged in to UIMA

Currently there's no easy way to plug in an additional kind of service
adapter (to support a protocol other than SOAP or Vinci).  UIMA
already has the foundation for pluggable adapters, with its use of
descriptors and factory methods that produce Resource objects (like
AnalysisEngines) from descriptors.  But we've never provided a way for
users to plug in their own adapter classes without editing internal
framework configuration files.  Here's a simple suggestion that would
change that:

We could add a new ResourceSpecifier (descriptor) type:
<customResourceSpecifier xmlns="http://uima.apache.org/resourceSpecifier">
	<resourceClassName>com.foo.MyCustomServiceAdapter</resourceClassName>
	<parameters>
		<parameter name="serviceEndpoint" value="hostname:port"/>
		...
	</parameters>
</customResourceSpecifier>

The <resourceClassName> specifies the exact name of some user class
which must be located on the classpath (the UIMA extension classpath
will work, if provided).  That class must implement the UIMA Resource
interface (for an AE service adapter it would also have to implement
the AnalysisEngine interface).  The Resource interface provides a
method initialize(ResouceSpecifier,Map) which the factory calls and
passes the resource specifier.  The user would implement the
initialize method to read the <parameters> and set itself up.

All the basic support for this is already there.  It's relatively easy
to add a new kind of ResourceSpecifier and the associated factory for
instantiating the Resource from the specifier.  Then there would be
the documentation about how to implement your resource class, which
would be a little more work.

Thoughts?

  -Adam

Re: Allowing custom service adapters to be plugged in to UIMA

Posted by Michael Baessler <mb...@michael-baessler.de>.
Adam Lally wrote:
> I implemented the customResourceSpecifier as described below and
> committed the changes.  Michael, maybe you can give this a try with
> your PearAnalysisEngineWrapper?

I change the implementation to use the customResourceSpecifier. And it 
seems that all works fine.
I checked in my changes.

Thanks for quick implementation.

-- Michael

Re: Allowing custom service adapters to be plugged in to UIMA

Posted by Adam Lally <al...@alum.rpi.edu>.
I implemented the customResourceSpecifier as described below and
committed the changes.  Michael, maybe you can give this a try with
your PearAnalysisEngineWrapper?

-Adam

On 3/14/07, Michael Baessler <mb...@michael-baessler.de> wrote:
> Adam Lally wrote:
> > Currently there's no easy way to plug in an additional kind of service
> > adapter (to support a protocol other than SOAP or Vinci).  UIMA
> > already has the foundation for pluggable adapters, with its use of
> > descriptors and factory methods that produce Resource objects (like
> > AnalysisEngines) from descriptors.  But we've never provided a way for
> > users to plug in their own adapter classes without editing internal
> > framework configuration files.  Here's a simple suggestion that would
> > change that:
> >
> > We could add a new ResourceSpecifier (descriptor) type:
> > <customResourceSpecifier
> > xmlns="http://uima.apache.org/resourceSpecifier">
> >     <resourceClassName>com.foo.MyCustomServiceAdapter</resourceClassName>
> >     <parameters>
> >         <parameter name="serviceEndpoint" value="hostname:port"/>
> >         ...
> >     </parameters>
> > </customResourceSpecifier>
> >
> > The <resourceClassName> specifies the exact name of some user class
> > which must be located on the classpath (the UIMA extension classpath
> > will work, if provided).  That class must implement the UIMA Resource
> > interface (for an AE service adapter it would also have to implement
> > the AnalysisEngine interface).  The Resource interface provides a
> > method initialize(ResouceSpecifier,Map) which the factory calls and
> > passes the resource specifier.  The user would implement the
> > initialize method to read the <parameters> and set itself up.
> >
> > All the basic support for this is already there.  It's relatively easy
> > to add a new kind of ResourceSpecifier and the associated factory for
> > instantiating the Resource from the specifier.  Then there would be
> > the documentation about how to implement your resource class, which
> > would be a little more work.
> >
> > Thoughts?
> This sounds very useful to me.
>
> +1 for doing this.
>
> -- Michael
>
>

Re: Allowing custom service adapters to be plugged in to UIMA

Posted by Michael Baessler <mb...@michael-baessler.de>.
Adam Lally wrote:
> Currently there's no easy way to plug in an additional kind of service
> adapter (to support a protocol other than SOAP or Vinci).  UIMA
> already has the foundation for pluggable adapters, with its use of
> descriptors and factory methods that produce Resource objects (like
> AnalysisEngines) from descriptors.  But we've never provided a way for
> users to plug in their own adapter classes without editing internal
> framework configuration files.  Here's a simple suggestion that would
> change that:
>
> We could add a new ResourceSpecifier (descriptor) type:
> <customResourceSpecifier 
> xmlns="http://uima.apache.org/resourceSpecifier">
>     <resourceClassName>com.foo.MyCustomServiceAdapter</resourceClassName>
>     <parameters>
>         <parameter name="serviceEndpoint" value="hostname:port"/>
>         ...
>     </parameters>
> </customResourceSpecifier>
>
> The <resourceClassName> specifies the exact name of some user class
> which must be located on the classpath (the UIMA extension classpath
> will work, if provided).  That class must implement the UIMA Resource
> interface (for an AE service adapter it would also have to implement
> the AnalysisEngine interface).  The Resource interface provides a
> method initialize(ResouceSpecifier,Map) which the factory calls and
> passes the resource specifier.  The user would implement the
> initialize method to read the <parameters> and set itself up.
>
> All the basic support for this is already there.  It's relatively easy
> to add a new kind of ResourceSpecifier and the associated factory for
> instantiating the Resource from the specifier.  Then there would be
> the documentation about how to implement your resource class, which
> would be a little more work.
>
> Thoughts?
This sounds very useful to me.

+1 for doing this.

-- Michael