fix the name of the name service etch source.

add services to the compile etch files for java script.

idea for log service.

git-svn-id: https://svn.apache.org/repos/asf/incubator/etch/branches/name-service@767955 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.classpath b/.classpath
index 582cc2d..477dfc9 100644
--- a/.classpath
+++ b/.classpath
@@ -44,6 +44,9 @@
 	<classpathentry kind="src" path="services/ns/src/main/java"/>
 	<classpathentry kind="src" path="services/ns/target/generated-sources/main/etch/java"/>
 	<classpathentry kind="src" path="services/ns/src/test/java"/>
+	<classpathentry kind="src" path="services/log/src/main/java"/>
+	<classpathentry kind="src" path="services/log/src/test/java"/>
+	<classpathentry kind="src" path="services/log/target/generated-sources/main/etch/java"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ETCH_DEPENDENT_JARS"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/scripts/compEtchFilesForJava.bat b/scripts/compEtchFilesForJava.bat
index 6de5c51..7013c7d 100644
--- a/scripts/compEtchFilesForJava.bat
+++ b/scripts/compEtchFilesForJava.bat
@@ -24,6 +24,7 @@
 
 @set testsdir=tests\src\main\etch
 @set examplesdir=examples
+@set servicesdir=services
 
 @set x=%CD%\
 @pushd %testsdir%
@@ -66,3 +67,14 @@
 @popd
 
 @popd
+@pushd %servicesdir%
+
+@pushd log\src\main\etch
+@call %x%scripts\etch-eclipse.bat %q% %b% %n% %d% %i%        LogService.etch
+@popd
+
+@pushd ns\src\main\etch
+@call %x%scripts\etch-eclipse.bat %q% %b% %n% %d% %i%        NameService.etch
+@popd
+
+@popd
diff --git a/services/log/src/main/etch/LogService.etch b/services/log/src/main/etch/LogService.etch
new file mode 100644
index 0000000..0f76937
--- /dev/null
+++ b/services/log/src/main/etch/LogService.etch
@@ -0,0 +1,54 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module org.apache.etch.services.log
+
+@Timeout( 4000 )
+service LogService
+{
+	boolean canOpenLog( string name )
+	
+	@Authorize( canOpenLog, name )
+	void openLog( string name )
+	
+	void closeLog()
+	
+	boolean isLogOpen()
+	
+	@Oneway
+	@Authorize( isLogOpen )
+	void writeLog( string entryId, object[] params )
+	
+	@Authorize( isLogOpen )
+	boolean isLogEnabled( string entryId )
+	
+	@Authorize( isLogOpen )
+	string[] getLogEnabled()
+	
+	@Authorize( isLogOpen )
+	void subscribeLogEnabled()
+	
+	@Authorize( isLogOpen )
+	void unsubscribeLogEnabled()
+	
+	@Oneway
+	@Direction( Client )
+	void logEnabledChanged( string[] entryIds )
+}
diff --git a/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceClient.java b/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceClient.java
new file mode 100644
index 0000000..209aa46
--- /dev/null
+++ b/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceClient.java
@@ -0,0 +1,49 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.etch.services.log;
+
+/**
+ * Your custom implementation of BaseLogServiceClient. Add methods here to provide
+ * implementations of messages from the server.
+ */
+public class ImplLogServiceClient extends BaseLogServiceClient
+{
+	/**
+	 * Constructs the ImplLogServiceClient.
+	 *
+	 * @param server a connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	public ImplLogServiceClient( RemoteLogServiceServer server )
+	{
+		this.server = server;
+	}
+	
+	/**
+	 * A connection to the server session. Use this to send a
+	 * message to the server.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemoteLogServiceServer server;
+
+	// TODO insert methods here to provide implementations of LogServiceClient
+	// messages from the server.
+}
\ No newline at end of file
diff --git a/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceServer.java b/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceServer.java
new file mode 100644
index 0000000..71a9a0a
--- /dev/null
+++ b/services/log/src/main/java/org/apache/etch/services/log/ImplLogServiceServer.java
@@ -0,0 +1,49 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.etch.services.log;
+
+/**
+ * Your custom implementation of BaseLogServiceServer. Add methods here to provide
+ * implementations of messages from the client.
+ */
+public class ImplLogServiceServer extends BaseLogServiceServer
+{
+	/**
+	 * Constructs the ImplLogServiceServer.
+	 *
+	 * @param client a connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	public ImplLogServiceServer( RemoteLogServiceClient client )
+	{
+		this.client = client;
+	}
+	
+	/**
+	 * A connection to the client session. Use this to send a
+	 * message to the client.
+	 */
+	@SuppressWarnings( "unused" )
+	private final RemoteLogServiceClient client;
+
+	// TODO insert methods here to provide implementations of LogServiceServer
+	// messages from the client.
+}
\ No newline at end of file
diff --git a/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceClient.java b/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceClient.java
new file mode 100644
index 0000000..0933bd4
--- /dev/null
+++ b/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceClient.java
@@ -0,0 +1,57 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.etch.services.log;
+
+/**
+ * Main program for LogServiceClient. This program makes a connection to the
+ * listener created by MainLogServiceListener.
+ */
+public class MainLogServiceClient implements LogServiceHelper.LogServiceClientFactory
+{
+	/**
+	 * Main program for LogServiceClient.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://localhost:4001";
+		
+		RemoteLogServiceServer server = LogServiceHelper.newServer( uri, null,
+			new MainLogServiceClient() );
+
+		// Connect to the service
+		server._startAndWaitUp( 4000 );
+
+		// TODO Insert Your Code Here
+
+		// Disconnect from the service
+		server._stopAndWaitDown( 4000 );
+	}
+
+	public LogServiceClient newLogServiceClient( RemoteLogServiceServer server )
+		throws Exception
+	{
+		return new ImplLogServiceClient( server );
+	}
+}
diff --git a/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceListener.java b/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceListener.java
new file mode 100644
index 0000000..eefbf9c
--- /dev/null
+++ b/services/log/src/main/java/org/apache/etch/services/log/MainLogServiceListener.java
@@ -0,0 +1,54 @@
+/* $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.etch.services.log;
+
+import org.apache.etch.bindings.java.support.ServerFactory;
+import org.apache.etch.util.core.io.Transport;
+
+/**
+ * Main program for LogServiceServer. This program makes a listener to accept
+ * connections from MainLogServiceClient.
+ */
+public class MainLogServiceListener implements LogServiceHelper.LogServiceServerFactory
+{
+	/**
+	 * Main program for LogServiceServer.
+	 * 
+	 * @param args command line arguments.
+	 * @throws Exception
+	 */
+	public static void main( String[] args ) throws Exception
+	{
+		// TODO Change to correct URI
+		String uri = "tcp://0.0.0.0:4001";
+		
+		ServerFactory listener = LogServiceHelper.newListener( uri, null,
+			new MainLogServiceListener() );
+
+		// Start the Listener
+		listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );
+	}
+
+	public LogServiceServer newLogServiceServer( RemoteLogServiceClient client )
+	{
+		return new ImplLogServiceServer( client );
+	}
+}
diff --git a/services/ns/src/main/etch/ns.etch b/services/ns/src/main/etch/NameService.etch
similarity index 100%
rename from services/ns/src/main/etch/ns.etch
rename to services/ns/src/main/etch/NameService.etch