KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > j2me > ClientImpl


1 /***
2  * Julia: France Telecom's implementation of the Fractal API
3  * Copyright (C) 2001-2002 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: Eric.Bruneton@rd.francetelecom.com
20  *
21  * Author: Eric Bruneton
22  */

23
24 package j2me;
25
26 import org.objectweb.fractal.api.control.BindingController;
27
28 public class ClientImpl implements Main, BindingController {
29
30   private Service service;
31
32   public void main (final String JavaDoc[] args) {
33     service.print("hello world");
34   }
35
36   public String JavaDoc[] listFc () {
37     return new String JavaDoc[] { "s" };
38   }
39
40   public Object JavaDoc lookupFc (final String JavaDoc cItf) {
41     if (cItf.equals("s")) {
42       return service;
43     }
44     return null;
45   }
46
47   public void bindFc (final String JavaDoc cItf, final Object JavaDoc sItf) {
48     if (cItf.equals("s")) {
49       service = (Service)sItf;
50     }
51   }
52
53   public void unbindFc (final String JavaDoc cItf) {
54     if (cItf.equals("s")) {
55       service = null;
56     }
57   }
58 }
59
Popular Tags