KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > services > ejb > remote > test > TesterBean


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.services.ejb.remote.test;
19
20
21 import javax.ejb.CreateException JavaDoc;
22 import javax.ejb.SessionBean JavaDoc;
23 import javax.ejb.SessionContext JavaDoc;
24
25 /**
26  * <p>Bean implementation for the TesterBean
27  *
28  * Copyright 2002 Sapient
29  * @see Tester
30  * @see TesterHome
31  * @version $Revision: 1.7 $
32  * @author $Author: dvoet $ $Date: 2003/11/05 17:45:16 $
33  */

34 public class TesterBean implements SessionBean JavaDoc {
35
36     /**
37      * Contains the SessionContext attribute for this instance
38      */

39     protected SessionContext JavaDoc ctx;
40
41     public void ejbCreate() throws CreateException JavaDoc {
42
43     }
44
45     public void ejbActivate() {
46
47     }
48
49     public void ejbPassivate() {
50
51     }
52
53     public void ejbRemove() {
54
55     }
56
57
58     /**
59      * Returns the SessionContext associated with this instance.
60      *
61      * @return javax.ejb.SessionContext
62      */

63     public SessionContext JavaDoc getSessionContext() {
64         return ctx;
65     }
66
67
68     /**
69      * Assigns the SessionContext of the current instance to the provided
70      * parameter.
71      *
72      * @param ctx the SessionContext to assign to this instance.
73      */

74     public void setSessionContext(SessionContext JavaDoc ctx) {
75         this.ctx = ctx;
76     }
77
78
79     /**
80      * Returns the name of the class of this object, used for debugging
81      * purposes.
82      *
83      * @return String Identification
84      */

85     public String JavaDoc id() {
86         return (this.getClass().getName());
87     }
88     
89     public void testMe() {
90         System.out.println(ctx.getCallerPrincipal().getName());
91     }
92 }
93
Popular Tags