deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Petracek (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (DELTASPIKE-113) Review and Discuss ServiceHandlers
Date Wed, 26 Dec 2012 17:24:13 GMT

    [ 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 5:22 PM:
-----------------------------------------------------------------------

usage supported by the first draft ( http://s.apache.org/1sB ):

//...
@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 (http://s.apache.org/1sB):

//...
@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();
}
                  
> 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

Mime
View raw message