You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2003/12/14 19:41:12 UTC

LifeCycle extensions

Hi,

while looking for alternate ways to implement the Security framework in 
Merlin, I took a peek at the LifeCycle extensions.

I am a bit hesitant to the current design.

 public interface Creator
 {
    void create( Object object, Context context )
        throws Exception;
    void destroy( Object object, Context context );
 }

and 

public interface Accessor
 {
    void access( Object object, Context context )
        throws Exception;

    void release( Object object, Context context );
 }

Shouldn't the create() and the access() methods return Object, which much be 
an object of the same type as the parameter object?

By doing that, it is possible to wrap any component with an pluggable 
interceptor mechanism. As it is now, that is not possible. Or am I supposed 
to do something like that elsewhere?

Furthermore, why does the component need to declare/associate the stage in its 
type declaration? It is not done for Serviceable? 
IMVHO, Life Cycle extensions are "Installed" into the container, and for each 
component the container checks if it implements the Extension interface, if 
so service it. 

An ideal LifeCycle extension system, would allow us to break out all the 
existing stages, and configure them via the extension mechanism. Wouldn't 
that be the ultimate goal? That is at the moment not possible, as I can't 
specify the stage order for construction.

Just some thoughts about the subject...

Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 16 December 2003 14:13, Stephen McConnell wrote:
> Niclas Hedhman wrote:
> >On Tuesday 16 December 2003 12:35, Stephen McConnell wrote:
> >>Some additional content - its not interceptor stuff, but its a lot more
> >>useful ..
> >>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycl
> >>e/ LifecycleCreateExtension.html
> >>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycl
> >>e/ LifecycleDestroyExtension.html Steve.
> >
> >Better ;o)
> >Q is then; Should we or should we not support "interception" and allow
> >Extensions to wrap components??
>
> A: yes - we should support "interception"
>
> As to "extensions wrapping components" - not sure what that means.

Another question, can I declare the factory for Service instance instead of an 
implementation class?

I think I saw it somewhere, but I haven't located now in all haste...

Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 16 December 2003 14:13, Stephen McConnell wrote:
> Niclas Hedhman wrote:
> >On Tuesday 16 December 2003 12:35, Stephen McConnell wrote:
> >>Some additional content - its not interceptor stuff, but its a lot more
> >>useful ..
> >>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycl
> >>e/ LifecycleCreateExtension.html
> >>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycl
> >>e/ LifecycleDestroyExtension.html Steve.
> >
> >Better ;o)
> >Q is then; Should we or should we not support "interception" and allow
> >Extensions to wrap components??
>
> A: yes - we should support "interception"
>
> As to "extensions wrapping components" - not sure what that means.

Instead of
void create(DeploymentModel model,
                   StageDescriptor stage,
                   Object object)
            throws Exception;

it is 

 Object create(DeploymentModel model,
                   StageDescriptor stage,
                   Object object)
            throws Exception;

where the returned Object is the "wrapped object", i.e. it still implements 
the Service interface, but may be a different object than given to the 
extension.

Clearer?

Niclas
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Stephen McConnell <mc...@apache.org>.

Niclas Hedhman wrote:

>On Tuesday 16 December 2003 12:35, Stephen McConnell wrote:
>  
>
>>Some additional content - its not interceptor stuff, but its a lot more
>>useful ..
>>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>>LifecycleCreateExtension.html
>>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>>LifecycleDestroyExtension.html Steve.
>>    
>>
>
>Better ;o) 
>Q is then; Should we or should we not support "interception" and allow 
>Extensions to wrap components??
>

A: yes - we should support "interception"

As to "extensions wrapping components" - not sure what that means.

Steve.

>
>Niclas
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Berin Loritsch <bl...@apache.org>.
Niclas Hedhman wrote:

> On Tuesday 16 December 2003 12:35, Stephen McConnell wrote:
> 
>>Some additional content - its not interceptor stuff, but its a lot more
>>useful ..
>>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>>LifecycleCreateExtension.html
>>http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>>LifecycleDestroyExtension.html Steve.
> 
> 
> Better ;o) 
> Q is then; Should we or should we not support "interception" and allow 
> Extensions to wrap components??

Interceptions are more flexible, though a little harder to program for.
The Extension stuff was used for some simple cases, of which we had already
identified the requirements for.

You can implement extensions with interceptors, but not the other way.
So I would not rule out interceptors for the long haul.


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 16 December 2003 12:35, Stephen McConnell wrote:
> Some additional content - its not interceptor stuff, but its a lot more
> useful ..
> http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>LifecycleCreateExtension.html
> http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/
>LifecycleDestroyExtension.html Steve.

Better ;o) 
Q is then; Should we or should we not support "interception" and allow 
Extensions to wrap components??

Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: LifeCycle extensions

Posted by Stephen McConnell <mc...@apache.org>.

Niclas Hedhman wrote:

>Hi,
>
>while looking for alternate ways to implement the Security framework in 
>Merlin, I took a peek at the LifeCycle extensions.
>
>I am a bit hesitant to the current design.
>
> public interface Creator
> {
>    void create( Object object, Context context )
>        throws Exception;
>    void destroy( Object object, Context context );
> }
>
>and 
>
>public interface Accessor
> {
>    void access( Object object, Context context )
>        throws Exception;
>
>    void release( Object object, Context context );
> }
>
>Shouldn't the create() and the access() methods return Object, which much be 
>an object of the same type as the parameter object?
>
>By doing that, it is possible to wrap any component with an pluggable 
>interceptor mechanism. As it is now, that is not possible. Or am I supposed 
>to do something like that elsewhere?
>
>Furthermore, why does the component need to declare/associate the stage in its 
>type declaration? It is not done for Serviceable? 
>IMVHO, Life Cycle extensions are "Installed" into the container, and for each 
>component the container checks if it implements the Extension interface, if 
>so service it. 
>
>An ideal LifeCycle extension system, would allow us to break out all the 
>existing stages, and configure them via the extension mechanism. Wouldn't 
>that be the ultimate goal? That is at the moment not possible, as I can't 
>specify the stage order for construction.
>
>Just some thoughts about the subject...
>

Some additional content - its not interceptor stuff, but its a lot more 
useful ..
http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/LifecycleCreateExtension.html
http://avalon.apache.org/merlin/api/org/apache/avalon/activation/lifecycle/LifecycleDestroyExtension.html
Steve.

>
>Niclas
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org