You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2012/12/26 17:46:12 UTC

[jira] [Comment Edited] (DELTASPIKE-113) Review and Discuss ServiceHandlers

    [ https://issues.apache.org/jira/browse/DELTASPIKE-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13539456#comment-13539456 ] 

Gerhard Petracek edited comment on DELTASPIKE-113 at 12/26/12 4:46 PM:
-----------------------------------------------------------------------

usage supported by the first draft:

//...
@InvocationHandlerBinding //provided by DS
public @interface PartialBeanBinding //custom binding annotation
{
}

@PartialBeanBinding
public class PartialBeanHandler implements InvocationHandler
{
    //optional:
    @Inject
    private BeanX beanX;

    //optional:
    @PostConstruct
    protected void onCreate()
    {
        //...
    }

    //optional:
    @PreDestroy
    protected void onDestroy()
    {
        //...
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
    {
        //...
    }
}

@PartialBeanBinding
@RequestScoped //any scope
public abstract class PartialBean
{
    //optional:
    @Inject
    private BeanX beanX;

    //optional:
    @PostConstruct
    protected void onCreate()
    {
        //...
    }

    //optional:
    @PreDestroy
    protected void onDestroy()
    {
        //...
    }

    public abstract void customMethod1();

    public void customMethod2()
    {
        //...
    }
}

//or:

@PartialBeanBinding
@RequestScoped //any scope
public interface PartialBean
{
    void customMethod1();
    void customMethod2();
}
                
      was (Author: gpetracek):
    usage supported by the first draft:

//...
@InvocationHandlerBinding
public @interface PartialBeanBinding
{
}

@PartialBeanBinding
public class PartialBeanHandler implements InvocationHandler
{
    //optional:
    @Inject
    private BeanX beanX;

    //optional:
    @PostConstruct
    protected void onCreate()
    {
        //...
    }

    //optional:
    @PreDestroy
    protected void onDestroy()
    {
        //...
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
    {
        //...
    }
}

@PartialBeanBinding
@RequestScoped //any scope
public abstract class PartialBean
{
    //optional:
    @Inject
    private BeanX beanX;

    //optional:
    @PostConstruct
    protected void onCreate()
    {
        //...
    }

    //optional:
    @PreDestroy
    protected void onDestroy()
    {
        //...
    }

    public abstract void customMethod1();

    public void customMethod2()
    {
        //...
    }
}

//or:

@PartialBeanBinding
@RequestScoped //any scope
public interface PartialBean
{
    void customMethod1();
    void customMethod2();
}
                  
> Review and Discuss ServiceHandlers
> ----------------------------------
>
>                 Key: DELTASPIKE-113
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-113
>             Project: DeltaSpike
>          Issue Type: Sub-task
>          Components: Core
>    Affects Versions: 0.1-incubating
>            Reporter: John D. Ament
>            Assignee: John D. Ament
>             Fix For: 0.4-incubating
>
>
> Discuss the Solder feature ServiceHandler

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira