KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > examples > components > helloworld > ClientImpl


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

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