You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Norbert Sándor <de...@erinors.com> on 2006/01/12 09:57:15 UTC

services...

Hello,

I have a service interface for public usage like

public interface MyService
{
    public void doSomething();
}

and one for internal usage (inside my framework)

public interface InternalMyService extends Service
{
    public void soSomethingInternal();
}

How should I define service point(s) in hivemodule.xml to allow:
- my framework classes to access the service as InternalMyService
- to force outside access as MyService

Thanks for your help!
BR,
Norbi

Re: services...

Posted by Achim Huegen <ac...@gmx.de>.
You won't be able to solve this problem simply by defining
service points in the right way, if you plan to use only
one implementation class.
I would suggest to implement two classes: InternalMyServiceImpl
and MyServiceImpl.
While InternalMyServiceImpl does all the work, MyServiceImpl just 
delegates all public method calls to
a instance of InternalMyServiceImpl which is injected
as dependency.

This will result in two service points. The InternalMyService
service point can be hidden from the outside by using 
visibility="private" attribute.

Achim


Norbert Sándor wrote:
> 
> Hello,
>  
> I have a service interface for public usage like
>  
> public interface MyService
> {
>     public void doSomething();
> }
>  
> and one for internal usage (inside my framework)
>  
> public interface InternalMyService extends Service
> {
>     public void soSomethingInternal();
> }
>  
> How should I define service point(s) in hivemodule.xml to allow:
> - my framework classes to access the service as InternalMyService
> - to force outside access as MyService
>  
> Thanks for your help!
> BR,
> Norbi

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org