KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > service > ServiceFive


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.ejb3.test.service;
23
24 import javax.management.ObjectName JavaDoc;
25 import org.jboss.annotation.ejb.Depends;
26 import org.jboss.annotation.ejb.Management;
27 import org.jboss.annotation.ejb.Service;
28
29 /**
30  * @author <a HREF="mailto:kabir.khan@jboss.org">Kabir Khan</a>
31  * @version $Revision: 39699 $
32  */

33 @Service
34 @Management(ServiceFiveManagement.class)
35 public class ServiceFive implements ServiceFiveManagement
36 {
37    @Depends("jboss.ejb3:management=interface,with=customName,is=serviceThree")
38    public ServiceThreeManagement serviceThreeA;
39
40    @Depends("jboss.j2ee:service=EJB3,jar=service-test.jar,name=ServiceFour,type=ManagementInterface")
41    public ObjectName JavaDoc serviceFourA;
42
43    private ServiceThreeManagement serviceThreeB;
44    private ObjectName JavaDoc serviceFourB;
45
46    @Depends("jboss.ejb3:management=interface,with=customName,is=serviceThree")
47    public void setServiceThree(ServiceThreeManagement proxy)
48    {
49       serviceThreeB = proxy;
50    }
51
52    @Depends("jboss.j2ee:service=EJB3,jar=service-test.jar,name=ServiceFour,type=ManagementInterface")
53    public void setServiceFour(ObjectName JavaDoc on)
54    {
55       serviceFourB = on;
56    }
57
58    public void create() throws Exception JavaDoc
59    {
60       System.out.println("ServiceFive - CREATE");
61       Tester.creates.add("5");
62    }
63
64    public void start() throws Exception JavaDoc
65    {
66       System.out.println("ServiceFive - START");
67       Tester.starts.add("5");
68    }
69
70    public boolean getInjectedProxyField()
71    {
72       return serviceThreeA != null;
73    }
74
75    public boolean getInjectedObjectNameField()
76    {
77       return serviceFourA != null;
78    }
79
80    public boolean getInjectedProxyMethod()
81    {
82       return serviceThreeB != null;
83    }
84
85    public boolean getInjectedObjectNameMethod()
86    {
87       return serviceFourB != null;
88    }
89 }
90
Popular Tags