KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > base > distributed > AdminEJBTimerEventListenerImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.ejb.base.distributed;
25
26 import com.sun.ejb.spi.distributed.DistributedEJBService;
27 import com.sun.ejb.spi.distributed.DistributedEJBServiceFactory;
28
29 import com.sun.enterprise.admin.event.EjbTimerEvent;
30 import com.sun.enterprise.admin.event.EjbTimerEventListener;
31 import com.sun.enterprise.admin.event.AdminEventListenerRegistry;
32 import com.sun.enterprise.admin.event.AdminEventListenerException;
33
34 /**
35  * Implementation of Admin infrastructure EjbTimerEventListener interface
36  * add @author:
37  * add @Date:
38  * add @version:
39  */

40 public class AdminEJBTimerEventListenerImpl
41     extends EJBTimerBaseAction
42     implements EjbTimerEventListener
43 {
44     protected static EjbTimerEventListener ejbTimerEventListener =
45         new AdminEJBTimerEventListenerImpl();
46
47     static {
48         AdminEventListenerRegistry.addEjbTimerEventListener(
49             ejbTimerEventListener );
50     }
51
52     public static EjbTimerEventListener getEjbTimerEventListener() {
53         return ejbTimerEventListener;
54     }
55
56     private AdminEJBTimerEventListenerImpl() {
57         super();
58     }
59  
60     public int migrateTimer( EjbTimerEvent event, String JavaDoc fromServerId )
61         throws AdminEventListenerException
62     {
63         try {
64             return migrateTimers( fromServerId );
65         } catch( Exception JavaDoc ex ) {
66             AdminEventListenerException adminEx = new AdminEventListenerException();
67             adminEx.initCause( ex );
68             throw adminEx;
69         }
70     }
71
72     public String JavaDoc[] listTimers(EjbTimerEvent event, String JavaDoc[] servers)
73         throws AdminEventListenerException
74     {
75         try {
76             return listTimers( servers );
77         } catch( Exception JavaDoc ex ) {
78             AdminEventListenerException adminEx = new AdminEventListenerException();
79             adminEx.initCause( ex );
80             throw adminEx;
81         }
82     }
83
84 } //AdminEJBTimerEventListenerImpl.java
85
Popular Tags