Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/service In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3112/src/test/com/bigdata/service Added Files: TestServiceDiscovery.java TestService.properties ITestService.java TestServer.java TestServer.config TestAll.java Log Message: Working on service startup and signal handling. --- NEW FILE: TestService.properties --- file=TestService.jnl --- NEW FILE: TestServiceDiscovery.java --- /** The Notice below must appear in each file of the Source Code of any copy you distribute of the Licensed Product. Contributors to any Modifications may add their own copyright notices to identify their own contributions. License: The contents of this file are subject to the CognitiveWeb Open Source License Version 1.1 (the License). You may not copy or use this file, in either source code or executable form, except in compliance with the License. You may obtain a copy of the License from http://www.CognitiveWeb.org/legal/license/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyrights: Portions created by or assigned to CognitiveWeb are Copyright (c) 2003-2003 CognitiveWeb. All Rights Reserved. Contact information for CognitiveWeb is available at http://www.CognitiveWeb.org Portions Copyright (c) 2002-2003 Bryan Thompson. Acknowledgements: Special thanks to the developers of the Jabber Open Source License 1.0 (JOSL), from which this License was derived. This License contains terms that differ from JOSL. Special thanks to the CognitiveWeb Open Source Contributors for their suggestions and support of the Cognitive Web. Modifications: */ /* * Created on Jun 16, 2006 */ package com.bigdata.service; import java.io.IOException; import java.net.InetAddress; import java.rmi.ConnectException; import junit.framework.TestCase; import net.jini.core.discovery.LookupLocator; import net.jini.core.lookup.ServiceRegistrar; import net.jini.core.lookup.ServiceTemplate; import org.apache.log4j.Logger; /** * <p> * Test the ability to register, discover, and invoke a jini service. * </p> * <p> * Note: jini MUST be running. You can get the jini starter kit and install it * to get jini running. * </p> * <p> * Note: The registered service will NOT show up correctly in the Service * Browser (you will see "Unknown service") unless you set the codebase when * executing this test class and the .class files are available for download * from the codebase URL. I jump start the tests myself by copying them onto an * HTTP server and using the following options in the command line to execute * the test: * </p> * * <pre> * -Djava.security.policy=policy.all * -Djava.rmi.server.codebase=http://proto.cognitiveweb.org/maven-repository/bigdata/jars/ * </pre> * * <p> * which presuposes that the required class files are on that server available * for download. The security policy is overlax, but you do need to grant some * privledges in order to partitipate in discovery, etc. * </p> * * @todo While service lookup is unicast, service registration is multicast. * Probably both should be unicast for the purposes of this test. * * @todo The basic configuration should require only jini-core.jar. Figure out * how to get remote class loading working so that the requirements on a * client remain that minimal. Right now I am also using jini-ext.jar, * reggie.jar and sun-util.jar to run this test. jini-ext.jar is the big * one at over 1M. (this can be facilitated using the dljar ant task and * specifing jini-core as the target platform.) * * @todo Figure out how to divide the service into a proxy and a remote object. * We need this in order to measure the cost of sending data across the * network. * * @todo Explore the jini {@link net.jini.core.transaction.Transaction} model. * Perhaps we can use this as is to support two phase commits across the * database segments? The transaction model does not impose any semantics, * e.g., there is no locking, but we can handle all of that. * * @version $Id$ * @author <a href="mailto:tho...@us...">Bryan Thompson * </a> */ public class TestServiceDiscovery extends TestCase { public static Logger log = Logger.getLogger(TestServiceDiscovery.class); /** * Tests spans several services and verifies that we can discovery each of * them. * * @throws IOException * @throws ClassNotFoundException */ public void test_serviceDiscovery() throws IOException, ClassNotFoundException { /* * Install suitable security manager. this is required before the client * can download code. The code will be downloaded from the HTTP server * identified by the codebase property specified for the VM running the * service. For the purposes of this test, we are using the _same_ VM to * run the client and the service, so you have to specify the codebase * property when running the test. */ System.setSecurityManager(new SecurityManager()); /* * Launch the server to which we will connect (this is being done by the * test harness rather than setting up activation for the service since * we want to explicitly control the service instances for the purpose * of testing). */ TestServer.launchServer(); /* * Lookup the discover service (unicast on localhost). */ // get the hostname. InetAddress addr = InetAddress.getLocalHost(); String hostname = addr.getHostName(); // Find the service registrar (unicast protocol). final int timeout = 4*1000; // seconds. System.err.println("hostname: "+hostname); LookupLocator lookupLocator = new LookupLocator("jini://"+hostname); ServiceRegistrar serviceRegistrar = lookupLocator.getRegistrar( timeout ); /* * Prepare a template for lookup search. * * Note: The client needs a local copy of the interface in order to be * able to invoke methods on the service without using reflection. The * implementation class will be downloaded from the codebase identified * by the server. */ ServiceTemplate template = new ServiceTemplate(// /* * use this to request the service by its serviceID. */ null, /* * Use this to filter services by an interface that they expose. */ new Class[] { ITestService.class }, /* * use this to filter for services by Entry attributes. */ null); /* * Lookup a service. This can fail if the service registrar has not * finished processing the service registration. If it does, you can * generally just retry the test and it will succeed. However this * points out that the client may need to wait and retry a few times if * you are starting everthing up at once (or just register for * notification events for the service if it is not found and enter a * wait state). */ ITestService service = null; for (int i = 0; i < 10 && service == null; i++) { service = (ITestService) serviceRegistrar .lookup(template /* , maxMatches */); if (service == null) { log.info("Service not found: sleeping..."); try { Thread.sleep(200); } catch (InterruptedException ex) { } } } assertNotNull("Could not find service.", service); service.invoke(); // Sleep for a bit so that I can inspect the service in the Service // Browser. try { Thread.sleep(10000); } catch (InterruptedException ex) { } /* * try service invocation again. if the service lease is canceled before * we do this then we should see an exception here. */ try { service.invoke(); fail("Expecting "+ConnectException.class); } catch(ConnectException ex) { log.info("Ignoring expected exception: "+ex); } } public static void main(String[] args) throws Exception { TestServiceDiscovery test = new TestServiceDiscovery(); test.setUp(); try { test.test_serviceDiscovery(); } finally { test.tearDown(); } } } --- NEW FILE: TestServer.java --- /** The Notice below must appear in each file of the Source Code of any copy you distribute of the Licensed Product. Contributors to any Modifications may add their own copyright notices to identify their own contributions. License: The contents of this file are subject to the CognitiveWeb Open Source License Version 1.1 (the License). You may not copy or use this file, in either source code or executable form, except in compliance with the License. You may obtain a copy of the License from http://www.CognitiveWeb.org/legal/license/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyrights: Portions created by or assigned to CognitiveWeb are Copyright (c) 2003-2003 CognitiveWeb. All Rights Reserved. Contact information for CognitiveWeb is available at http://www.CognitiveWeb.org Portions Copyright (c) 2002-2003 Bryan Thompson. Acknowledgements: Special thanks to the developers of the Jabber Open Source License 1.0 (JOSL), from which this License was derived. This License contains terms that differ from JOSL. Special thanks to the CognitiveWeb Open Source Contributors for their suggestions and support of the Cognitive Web. Modifications: */ /* * Created on Jun 19, 2006 */ package com.bigdata.service; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.rmi.Remote; import java.rmi.server.ExportException; import java.util.Properties; import net.jini.admin.JoinAdmin; import net.jini.config.Configuration; import net.jini.config.ConfigurationException; import net.jini.config.ConfigurationProvider; import net.jini.core.discovery.LookupLocator; import net.jini.core.entry.Entry; import net.jini.core.lookup.ServiceID; import net.jini.discovery.DiscoveryEvent; import net.jini.discovery.DiscoveryManagement; import net.jini.discovery.LookupDiscovery; import net.jini.discovery.LookupDiscoveryManager; import net.jini.export.Exporter; import net.jini.lease.LeaseListener; import net.jini.lease.LeaseRenewalEvent; import net.jini.lease.LeaseRenewalManager; import net.jini.lookup.JoinManager; import net.jini.lookup.ServiceIDListener; import org.apache.log4j.Logger; import com.bigdata.journal.Journal; import com.sun.jini.start.ServiceStarter; /** * Launches a server used by the test. The server is launched in a separate * thread that will die after a timeout, taking the server with it. The server * exposes some methods for testing, notably a method to test remote method * invocation and one to shutdown the server. * * @version $Id$ * @author <a href="mailto:tho...@us...">Bryan Thompson * </a> * * @todo work through use the {@link ServiceStarter} (in start.jar). I am having * trouble getting past some classpath errors using * * <pre> * java -Djava.security.policy=policy.all -classpath ant-deploy\reggie.jar;ant-deploy\jini-core.jar;ant-deploy\jini-ext.jar;ant-deploy\sun-util.jar;ant-deploy\bigdata.jar -jar ant-deploy\start.jar src\test\org\CognitiveWeb\bigdata\jini\TestServer.config * </pre> * * @todo support NIO protocol for data intensive APIs (data service, file * transfer). Research how heavy mashalling is and what options exist to * make it faster and lighter. */ public class TestServer implements LeaseListener, ServiceIDListener { public static final transient Logger log = Logger .getLogger(TestServer.class); private ServiceID serviceID; private DiscoveryManagement discoveryManager; private JoinManager joinManager; private Configuration config; private TestServiceImpl impl; private Exporter exporter; private ITestService proxy; private File serviceIdFile = null; /** * Server startup performs asynchronous multicast lookup discovery. The * {@link #discovered(DiscoveryEvent)} method is invoked asynchronously to * register a proxy for a {@link TestServiceImpl} instance. The protocol for * remote communications between the proxy and the {@link TestServiceImpl} * is specified by a {@link Configuration}. */ public TestServer(String[] args) { final String SERVICE_LABEL = "ServiceDescription"; final String ADVERT_LABEL = "AdvertDescription"; Entry[] entries = null; LookupLocator[] unicastLocators = null; String[] groups = null; try { config = ConfigurationProvider.getInstance(args); /* * Extract how the service will perform service discovery. */ groups = (String[]) config.getEntry(ADVERT_LABEL, "groups", String[].class, LookupDiscovery.ALL_GROUPS/* default */); unicastLocators = (LookupLocator[]) config.getEntry( ADVERT_LABEL, "unicastLocators", LookupLocator[].class, null/* default */); /* * Extract how the service will advertise itself from the * Configuration. */ entries = (Entry[]) config.getEntry(ADVERT_LABEL, "entries", Entry[].class, null/* default */); serviceIdFile = (File) config.getEntry(ADVERT_LABEL, "serviceIdFile", File.class); // default if(serviceIdFile.exists()) { try { serviceID = readServiceId(serviceIdFile); } catch(IOException ex) { log.fatal("Could not read serviceID from existing file: " + serviceIdFile); System.exit(1); } } else { log.info("New service instance - ServiceID will be assigned"); } /* * Extract how the service will provision itself from the * Configuration. */ // use the configuration to construct an exporter exporter = (Exporter) config.getEntry(// SERVICE_LABEL, // component "exporter", // name Exporter.class // type (of the return object) ); /* * Access the properties file used to configure the service. */ File propertyFile = (File) config.getEntry(SERVICE_LABEL, "propertyFile", File.class); Properties properties = new Properties(); try { InputStream is = new BufferedInputStream(new FileInputStream( propertyFile)); properties.load(is); is.close(); } catch (IOException ex) { log.fatal("Configuration error: "+ex, ex); System.exit(1); } // create the service object. impl = new TestServiceImpl(properties); // export a proxy object for this service instance. proxy = (ITestService) exporter.export(impl); log.info("Proxy is " + proxy + "(" + proxy.getClass() + ")"); } catch(ConfigurationException ex) { log.fatal("Configuration error: "+ex, ex); System.exit(1); } catch (ExportException ex) { log.fatal("Export error: "+ex, ex); System.exit(1); } try { /* * Note: This class will perform multicast discovery if ALL_GROUPS * is specified and otherwise requires you to specify one or more * unicast locators (URIs of hosts running discovery services). As * an alternative, you can use LookupDiscovery, which always does * multicast discovery. */ discoveryManager = new LookupDiscoveryManager( groups, unicastLocators, null // DiscoveryListener ); // DiscoveryManagement discoveryManager = new LookupDiscovery( // groups); if (serviceID != null) { /* * We read the serviceID from local storage. */ joinManager = new JoinManager(proxy, // service proxy entries, // attr sets serviceID, // ServiceIDListener discoveryManager, // DiscoveryManager new LeaseRenewalManager()); } else { /* * We are requesting a serviceID from the registrar. */ joinManager = new JoinManager(proxy, // service proxy entries, // attr sets this, // ServiceIDListener discoveryManager, // DiscoveryManager new LeaseRenewalManager()); } } catch (IOException ex) { log.fatal("Lookup service discovery error: "+ex, ex); try { /* unexport the proxy */ unexport(true); joinManager.terminate(); discoveryManager.terminate(); } catch (Throwable t) { /* ignore */ } System.exit(1); } } // /* // * @todo look into this as an alternative means to shutdown a service. // */ // void shutdown() { // try { // Object admin = ((Administrable) proxy).getAdmin(); // DestroyAdmin destroyAdmin = (DestroyAdmin) admin; // destroyAdmin.destroy(); // } catch (RemoteException e) { // handle // // exception // // // } // } /** * Unexports the proxy. * * @param force * When true, the object is unexported even if there are pending * or in progress service requests. * * @return true iff the object is (or was) unexported. * * @see Exporter#unexport(boolean) */ public boolean unexport(boolean force) { if(exporter.unexport(true)) { proxy = null; return true; } return false; } /** * Read and return the {@link ServiceID} from an existing local file. * * @param file * The file whose contents are the serialized {@link ServiceID}. * * @return The {@link ServiceID} read from that file. * * @exception IOException * if the {@link ServiceID} could not be read from the file. */ public ServiceID readServiceId(File file) throws IOException { FileInputStream is = new FileInputStream(file); ServiceID serviceID = new ServiceID(new DataInputStream(is)); is.close(); log.info("Read ServiceID=" + serviceID+" from "+file); return serviceID; } /** * This method is responsible for saving the {@link ServiceID} on stable * storage when it is invoked. It will be invoked iff the {@link ServiceID} * was not defined and one was therefore assigned. * * @param serviceID * The assigned {@link ServiceID}. */ public void serviceIDNotify(ServiceID serviceID) { log.info("serviceID=" + serviceID); if (serviceIdFile != null) { try { DataOutputStream dout = new DataOutputStream( new FileOutputStream(serviceIdFile)); serviceID.writeBytes(dout); dout.flush(); dout.close(); log.info("ServiceID saved: " + serviceIdFile); } catch (Exception ex) { log.error("Could not save ServiceID", ex); } } } /** * Note: This is only invoked if the automatic lease renewal by the lease * manager is denied by the service registrar. * * @todo how should we handle being denied a lease? Wait a bit and try * re-registration? There can be multiple discovery services and this * is only one lease rejection, so perhaps the service is still under * lease on another discovery service? */ public void notify(LeaseRenewalEvent event) { log.error("Lease could not be renewed: " + event); } /** * Launch the server in a separate thread. * <p> * Note: The location of the test service configuration is hardwired to a * test resource. */ public static void launchServer() { new Thread("launchServer") { public void run() { TestServer .main(new String[] { "src/test/com/bigdata/service/TestServer.config" }); } }.start(); log.info("Starting service."); } /** * Run the server. It will die after a timeout. * * @param args * Ignored. */ public static void main(String[] args) { final long lifespan = 5 * 1000; // life span in seconds. log.info("Will start test server."); TestServer testServer = new TestServer(args); log.info("Started test server."); try { Thread.sleep(lifespan); } catch( InterruptedException ex ) { log.warn(ex); } /* * Terminate manager threads. */ try { log.info("Terminating manager threads."); testServer.joinManager.terminate(); testServer.discoveryManager.terminate(); } catch (Exception ex) { log.error("Could not terminate: "+ex, ex); } /* * Unexport the proxy, making the service no longer available. If you do * not do this then the client can still make requests even after you * have terminated the join manager and the service is no longer visible * in the service browser. */ log.info("Unexporting the service proxy."); testServer.unexport(true); // /* // * Note: The reference to the service instance here forces a hard // * reference to remain for the test server. If you comment out this log // * statement, then you need to do something else to hold onto the hard // * reference. // */ // log.info("Server will die: "+testServer); } // /** // * {@link Status} is abstract so a service needs to provide their own // * concrete implementation. // * // * @version $Id$ // * @author <a href="mailto:tho...@us...">Bryan Thompson</a> // * @download // */ // public static class MyStatus extends Status { // // /** // * // */ // private static final long serialVersionUID = 3431522046169284463L; // // /** // * Deserialization constructor (required). // */ // public MyStatus(){} // // public MyStatus(StatusType statusType) { // // /* // * Note: This just sets the read/write public [severity] field on // * the super class. // */ // super(statusType); // // } // // } // // /** // * {@link ServiceType} is abstract so a service basically needs to provide // * their own concrete implementation. This class does not support icons // * (always returns null for {@link ServiceType#getIcon(int)}. See // * {@link java.beans.BeanInfo} for how to interpret and support the // * getIcon() method. // * // * @version $Id$ // * @author <a href="mailto:tho...@us...">Bryan Thompson // * </a> // * @download // */ // public static class MyServiceType extends ServiceType // { // // /** // * // */ // private static final long serialVersionUID = -2088608425852657477L; // // public String displayName; // public String shortDescription; // // /** // * Deserialization constructor (required). // */ // public MyServiceType() {} // // public MyServiceType(String displayName, String shortDescription) { // this.displayName = displayName; // this.shortDescription = shortDescription; // } // // public String getDisplayName() { // return displayName; // } // // public String getShortDescription() { // return shortDescription; // } // // } /** * The remote service implementation object. This implements the * {@link Remote} interface and uses JERI to create a proxy for the remote * object and configure and manage the protocol for communications between * the client (service proxy) and the remote object (the service * implementation). * <p> * Note: You have to implement {@link JoinAdmin} in order to show up as an * administerable service (blue folder) in the jini Service Browser. * * @version $Id$ * @author <a href="mailto:tho...@us...">Bryan Thompson * </a> */ public static class TestServiceImpl implements ITestService { /** * Service constructor. * * @param properties */ public TestServiceImpl(Properties properties) { log.info("Created: " + this ); new Journal(properties); } public void invoke() { log.info("invoked: "+this); } } } --- NEW FILE: TestServer.config --- import java.io.*; import net.jini.jeri.BasicILFactory; import net.jini.jeri.BasicJeriExporter; import net.jini.jeri.tcp.TcpServerEndpoint; import net.jini.core.discovery.LookupLocator; import net.jini.discovery.LookupDiscovery; import net.jini.core.entry.Entry; import net.jini.lookup.entry.Name; import net.jini.lookup.entry.Comment; import net.jini.lookup.entry.Address; import net.jini.lookup.entry.Location; import net.jini.lookup.entry.ServiceInfo; import java.io.File; import com.sun.jini.config.ConfigUtil; import com.sun.jini.start.ServiceDescriptor; import com.sun.jini.start.NonActivatableServiceDescriptor; /* * Declares how the service will provision itself. */ ServiceDescription { /* * This object is used to export the service proxy. The choice here effects * the protocol that will be used for communications between the clients and * the service. * * @todo Explore JERI nio option and customization support for serialization. */ exporter = new BasicJeriExporter(TcpServerEndpoint.getInstance(0), new BasicILFactory()); /* * Code base for downloadable code exposed by this service. */ private static codebase = "http://proto.cognitiveweb.org/maven-repository/bigdata/jars/"; /* @todo restrict the policy to what is actually required by the service. * Among other things, we only need access to a temporary directory and * to the directory in which the journals and index segments will be * stored, not general read/write on the disk. */ private static policy = "policy.all"; /* * The directory containing the various JARs. */ private static libdir = "ant-deploy"+File.separator; /* * Declare dependencies for the server here. */ private static classpath = // jini libdir+"reggie.jar"+File.pathSeparator+ libdir+"jini-core.jar"+File.pathSeparator+ libdir+"jini-ext.jar"+File.pathSeparator+ libdir+"sun-util.jar"+File.pathSeparator+ // utility JARs. libdir+"log4j-1.2.8.jar"+File.pathSeparator+ libdir+"ctc_utils-5-4-2005.jar"+File.pathSeparator+ libdir+"lgpl-utils-1.0-b1-dev.jar"+File.pathSeparator+ libdir+"cweb-extser-0.1-b2-dev.jar"+File.pathSeparator+ // ICU (unicode support). libdir+"icu4j-3_6.jar"+File.pathSeparator+ // test suites only! libdir+"junit-3.8.1.jar"+File.pathSeparator+ libdir+"cweb-junit-ext-1.1-b2-dev.jar"+File.pathSeparator+ // main bigdata JAR. libdir+"bigdata.jar" ; /* * The name of the property file containing the configuration information for * the service itself (where it will locate its files, etc). */ propertyFile = new File("src/test/com/bigdata/service/TestService.properties"); static serviceDescriptors = new ServiceDescriptor[] { new NonActivatableServiceDescriptor( codebase, policy, classpath, "config.FileClassifierServerConfig", new String[] { propertyFile}) }; } /* * Declares how the service will advertise itself. */ AdvertDescription { /* * Entry attributes used to describe the service. */ entries = new Entry[] { new Comment("Test service"), // human facing comment. new Name("Test service"), // human facing name. new Location("floor","room","building"), new Address("street", "organization", "organizationalUnit", "locality", "stateOrProvince", "postalCode", "country"), new ServiceInfo("bigdata", // product or package name "SYSTAP,LLC", // manufacturer "SYSTAP,LLC", // vendor "0.1-beta", // version "bigdata", // model "serial#" // serialNumber ) }; /* * Note: multicast discovery is always used if LookupDiscovery.ALL_GROUPS is * specified. */ // groups = LookupDiscovery.ALL_GROUPS; groups = new String[]{"bigdata"}; /* * One or more unicast URIs of the form jini://host/ or jini://host:port/. * This MAY be an empty array if you want to use multicast discovery _and_ * you have specified LookupDiscovery.ALL_GROUPS above. */ unicastLocators = new LookupLocator[] { // empty new LookupLocator("jini://localhost/") // new LookupLocator("jini://SYSTAP-BBT.systap.com/") }; /* * The file on which the serviceID will be written. */ serviceIdFile = new File("TestService.id"); } --- NEW FILE: TestAll.java --- /** The Notice below must appear in each file of the Source Code of any copy you distribute of the Licensed Product. Contributors to any Modifications may add their own copyright notices to identify their own contributions. License: The contents of this file are subject to the CognitiveWeb Open Source License Version 1.1 (the License). You may not copy or use this file, in either source code or executable form, except in compliance with the License. You may obtain a copy of the License from http://www.CognitiveWeb.org/legal/license/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyrights: Portions created by or assigned to CognitiveWeb are Copyright (c) 2003-2003 CognitiveWeb. All Rights Reserved. Contact information for CognitiveWeb is available at http://www.CognitiveWeb.org Portions Copyright (c) 2002-2003 Bryan Thompson. Acknowledgements: Special thanks to the developers of the Jabber Open Source License 1.0 (JOSL), from which this License was derived. This License contains terms that differ from JOSL. Special thanks to the CognitiveWeb Open Source Contributors for their suggestions and support of the Cognitive Web. Modifications: */ /* * Created on Jun 26, 2006 */ package com.bigdata.service; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Aggregates tests in dependency order. * * @version $Id$ * @author <a href="mailto:tho...@us...">Bryan Thompson</a> */ public class TestAll extends TestCase { public TestAll() {} public TestAll(String name) {super(name);} public static Test suite() { TestSuite suite = new TestSuite(TestAll.class.getName()); suite.addTestSuite( TestServiceDiscovery.class ); // suite.addTestSuite( TestServer.class ); // Does not implement TestCase. return suite; } } --- NEW FILE: ITestService.java --- /** The Notice below must appear in each file of the Source Code of any copy you distribute of the Licensed Product. Contributors to any Modifications may add their own copyright notices to identify their own contributions. License: The contents of this file are subject to the CognitiveWeb Open Source License Version 1.1 (the License). You may not copy or use this file, in either source code or executable form, except in compliance with the License. You may obtain a copy of the License from http://www.CognitiveWeb.org/legal/license/ Software distributed under the License is distributed on an AS IS basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Copyrights: Portions created by or assigned to CognitiveWeb are Copyright (c) 2003-2003 CognitiveWeb. All Rights Reserved. Contact information for CognitiveWeb is available at http://www.CognitiveWeb.org Portions Copyright (c) 2002-2003 Bryan Thompson. Acknowledgements: Special thanks to the developers of the Jabber Open Source License 1.0 (JOSL), from which this License was derived. This License contains terms that differ from JOSL. Special thanks to the CognitiveWeb Open Source Contributors for their suggestions and support of the Cognitive Web. Modifications: */ /* * Created on Mar 18, 2007 */ package com.bigdata.service; import java.io.IOException; import java.rmi.Remote; import java.rmi.RemoteException; /** * The public interface for a test service. * <p> * Note: The interface extends {@link Remote} so that both the implementation of * this service and the proxy generated by jeri for the service will implement * this interface. This is necessary for service discovery or the resulting * proxy will NOT implement the interface and both service discovery (based on * the interface name) and use of the interface via the proxy will fail. * * @author <a href="mailto:tho...@us...">Bryan Thompson</a> * @version $Id$ * @download */ public interface ITestService extends Remote { /** * Method for testing remote invocation. * <p> * Note: The methods on a {@link Remote} interface MUST throw * {@link RemoteException} (or {@link IOException} if you want to reduce * your dependency on JINI for an interface that is also used outside of * JINI). */ public void invoke() throws RemoteException; } |