diff options
Diffstat (limited to 'java/demo')
249 files changed, 4917 insertions, 298 deletions
diff --git a/java/demo/Database/.DS_Store b/java/demo/Database/.DS_Store Binary files differnew file mode 100644 index 00000000000..ca6143d6f15 --- /dev/null +++ b/java/demo/Database/.DS_Store diff --git a/java/demo/Database/library/BookI.java b/java/demo/Database/library/BookI.java new file mode 100644 index 00000000000..5176584b3cf --- /dev/null +++ b/java/demo/Database/library/BookI.java @@ -0,0 +1,382 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +// +// This servant is a default servant. The book identity is retrieved +// from the Ice.Current object. +// +class BookI extends _BookDisp +{ + public void + ice_ping(Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + throw new Ice.ObjectNotExistException(); + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public BookDescription + describe(Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + throw new Ice.ObjectNotExistException(); + } + return extractDescription(context, rs, current.adapter); + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + setTitle(String title, Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("UPDATE books SET title = ? WHERE id = ?"); + stmt.setString(1, title); + stmt.setInt(2, id); + int count = stmt.executeUpdate(); + assert count == 1; + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + setAuthors(java.util.List<String> authors, Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + // First destroy each of the authors_books records. + java.sql.PreparedStatement stmt = context.prepareStatement("DELETE FROM authors_books WHERE book_id = ?"); + stmt.setInt(1, id); + stmt.executeUpdate(); + + // + // Convert the authors string to an id set. + // + java.util.List<Integer> authIds = new java.util.LinkedList<Integer>(); + java.util.Iterator<String> p = authors.iterator(); + while(p.hasNext()) + { + String author = p.next(); + + Integer authid; + stmt = context.prepareStatement("SELECT * FROM authors WHERE name = ?"); + stmt.setString(1, author); + java.sql.ResultSet rs = stmt.executeQuery(); + if(rs.next()) + { + // If there is a result, then the database + // already contains this author. + authid = rs.getInt(1); + assert !rs.next(); + } + else + { + // Otherwise, create a new author record. + stmt = context.prepareStatement("INSERT INTO authors (name) VALUES(?)", + java.sql.Statement.RETURN_GENERATED_KEYS); + stmt.setString(1, author); + int count = stmt.executeUpdate(); + assert count == 1; + rs = stmt.getGeneratedKeys(); + boolean next = rs.next(); + assert next; + authid = rs.getInt(1); + } + + // Add the new id to the list of ids. + authIds.add(authid); + } + + // Create new authors_books records. + java.util.Iterator<Integer> q = authIds.iterator(); + while(q.hasNext()) + { + stmt = context.prepareStatement("INSERT INTO authors_books (book_id, author_id) VALUES(?, ?)"); + stmt.setInt(1, id); + stmt.setInt(2, q.next()); + int count = stmt.executeUpdate(); + assert count == 1; + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + destroy(Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("DELETE FROM books WHERE id = ?"); + stmt.setInt(1, id); + int count = stmt.executeUpdate(); + if(count == 0) + { + throw new Ice.ObjectNotExistException(); + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public String + getRenter(Ice.Current current) + throws BookNotRentedException + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + throw new Ice.ObjectNotExistException(); + } + + int renterId = rs.getInt("renter_id"); + if(rs.wasNull()) + { + throw new BookNotRentedException(); + } + + stmt = context.prepareStatement("SELECT * FROM customers WHERE id = ?"); + stmt.setInt(1, renterId); + rs = stmt.executeQuery(); + boolean next = rs.next(); + assert next; + return rs.getString("name"); + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + rentBook(String name, Ice.Current current) + throws InvalidCustomerException, BookRentedException + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + name = name.trim(); + if(name.length() == 0) + { + throw new InvalidCustomerException(); + } + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + throw new Ice.ObjectNotExistException(); + } + + Integer renterId = rs.getInt("renter_id"); + if(!rs.wasNull()) + { + stmt = context.prepareStatement("SELECT * FROM customers WHERE id = ?"); + stmt.setInt(1, renterId); + rs = stmt.executeQuery(); + boolean next = rs.next(); + assert next; + throw new BookRentedException(rs.getString("name")); + } + + stmt = context.prepareStatement("SELECT * FROM customers WHERE name = ?"); + stmt.setString(1, name); + rs = stmt.executeQuery(); + + if(rs.next()) + { + renterId = rs.getInt("id"); + assert !rs.next(); + } + else + { + stmt = context.prepareStatement("INSERT into customers (name) VALUES(?)", + java.sql.Statement.RETURN_GENERATED_KEYS); + stmt.setString(1, name); + int count = stmt.executeUpdate(); + assert count == 1; + rs = stmt.getGeneratedKeys(); + boolean next = rs.next(); + assert next; + renterId = rs.getInt(1); + } + + stmt = context.prepareStatement("UPDATE books SET renter_id = ? WHERE id = ?"); + stmt.setInt(1, renterId); + stmt.setInt(2, id); + int count = stmt.executeUpdate(); + assert count == 1; + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + returnBook(Ice.Current current) + throws BookNotRentedException + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + Integer id = new Integer(current.id.name); + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + throw new Ice.ObjectNotExistException(); + } + Integer renterId = rs.getInt("renter_id"); + if(rs.wasNull()) + { + throw new BookNotRentedException(); + } + + stmt = context.prepareStatement("UPDATE books SET renter_id = NULL WHERE id = ?"); + stmt.setInt(1, id); + int count = stmt.executeUpdate(); + assert count == 1; + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + BookI() + { + } + + static Ice.Identity + createIdentity(Integer bookId) + { + Ice.Identity id = new Ice.Identity(); + id.category = "book"; + id.name = bookId.toString(); + return id; + } + + static BookDescription + extractDescription(SQLRequestContext context, java.sql.ResultSet rs, Ice.ObjectAdapter adapter) + throws java.sql.SQLException + { + Integer id = rs.getInt("id"); + + BookDescription desc = new BookDescription(); + desc.isbn = rs.getString("isbn"); + desc.title = rs.getString("title"); + desc.authors = new java.util.LinkedList<String>(); + desc.proxy = BookPrxHelper.uncheckedCast(adapter.createProxy(createIdentity(id))); + + java.sql.PreparedStatement stmt = null; + // Query for the rentedBy. + Integer renterId = rs.getInt("renter_id"); + if(!rs.wasNull()) + { + stmt = context.prepareStatement("SELECT * FROM customers WHERE id = ?"); + stmt.setInt(1, renterId); + java.sql.ResultSet customerRS = stmt.executeQuery(); + boolean next = customerRS.next(); + assert next; + desc.rentedBy = customerRS.getString(2); + } + + // Query for the authors. + stmt = context.prepareStatement("SELECT * FROM authors INNER JOIN authors_books ON " + + "authors.id=authors_books.author_id AND authors_books.book_id = ?"); + stmt.setInt(1, id); + java.sql.ResultSet authorRS = stmt.executeQuery(); + while(authorRS.next()) + { + desc.authors.add(authorRS.getString("name")); + } + + return desc; + } +} diff --git a/java/demo/Database/library/BookQueryResultI.java b/java/demo/Database/library/BookQueryResultI.java new file mode 100644 index 00000000000..28316ecfd5a --- /dev/null +++ b/java/demo/Database/library/BookQueryResultI.java @@ -0,0 +1,97 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class BookQueryResultI extends _BookQueryResultDisp +{ + // The query result owns the SQLRequestContext object until + // destroyed. + BookQueryResultI(SQLRequestContext context, java.sql.ResultSet rs) + { + _context = context; + _rs = rs; + } + + synchronized public java.util.List<BookDescription> + next(int n, Ice.BooleanHolder destroyed, Ice.Current current) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + destroyed.value = false; + java.util.List<BookDescription> l = new java.util.LinkedList<BookDescription>(); + if(n <= 0) + { + return l; + } + boolean next = true; + try + { + for(int i = 0; i < n && next; ++i) + { + l.add(BookI.extractDescription(_context, _rs, current.adapter)); + next = _rs.next(); + } + } + catch(java.sql.SQLException e) + { + // Log the error, and raise an UnknownException. + _context.error("BookQueryResultI", e); + Ice.UnknownException ex = new Ice.UnknownException(); + ex.initCause(e); + throw ex; + } + + if(!next) + { + try + { + destroyed.value = true; + destroy(current); + } + catch(Exception e) + { + // Ignore. + } + } + + return l; + } + + synchronized public void + destroy(Ice.Current current) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + _destroyed = true; + _context.destroy(false); + + current.adapter.remove(current.id); + } + + // Called on application shutdown by the Library. + synchronized public void + shutdown() + { + if(!_destroyed) + { + _destroyed = true; + _context.destroy(false); + } + } + + private SQLRequestContext _context; + private java.sql.ResultSet _rs; + private boolean _destroyed = false; +} + diff --git a/java/demo/Database/library/Client.java b/java/demo/Database/library/Client.java new file mode 100644 index 00000000000..531acd00f4a --- /dev/null +++ b/java/demo/Database/library/Client.java @@ -0,0 +1,53 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +public class Client extends Ice.Application +{ + class ShutdownHook extends Thread + { + public void + run() + { + try + { + communicator().destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + } + } + } + + public int + run(String[] args) + { + if(args.length > 1) + { + System.err.println("Usage: " + appName() + " [file]"); + return 1; + } + + // + // Since this is an interactive demo we want to clear the + // Application installed interrupt callback and install our + // own shutdown hook. + // + setInterruptHook(new ShutdownHook()); + + return RunParser.runParser(appName(), args, communicator()); + } + + static public void + main(String[] args) + { + Client app = new Client(); + app.main("demo.Database.library.Client", args, "config.client"); + } +} diff --git a/java/demo/Database/library/ConnectionPool.java b/java/demo/Database/library/ConnectionPool.java new file mode 100644 index 00000000000..852f6388115 --- /dev/null +++ b/java/demo/Database/library/ConnectionPool.java @@ -0,0 +1,156 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +class ConnectionPool +{ + public synchronized void + destroy() + { + _destroyed = true; + while(_connections.size() != _nconnections) + { + try + { + wait(); + } + catch(InterruptedException e) + { + } + } + + while(!_connections.isEmpty()) + { + java.sql.Connection conn = _connections.removeFirst(); + try + { + conn.close(); + } + catch(java.sql.SQLException e) + { + } + } + } + + public synchronized java.sql.Connection + acquire() + { + while(_connections.isEmpty() && !_destroyed) + { + try + { + wait(); + } + catch(InterruptedException e) + { + } + } + if(_destroyed) + { + return null; + } + java.sql.Connection conn = _connections.removeFirst(); + + try + { + boolean closed = conn.isClosed(); + if(closed) + { + _logger.warning("ConnectionPool: lost connection to database"); + conn = null; + } + else + { + // Probe the connection with the database. + java.sql.PreparedStatement stmt = conn.prepareStatement("SELECT 1"); + java.sql.ResultSet rs = stmt.executeQuery(); + stmt.close(); + } + } + catch(java.sql.SQLException e) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + e.printStackTrace(pw); + pw.flush(); + _logger.warning("ConnectionPool: lost connection to database:\n" + sw.toString()); + + conn = null; + } + + // If the connection has been closed, or is otherwise invalid, + // we need to re-establish the connection. + while(conn == null) + { + if(_trace) + { + _logger.trace("ConnectionPool", "establishing new database connection"); + } + try + { + conn = java.sql.DriverManager.getConnection(_url, _username, _password); + conn.setAutoCommit(false); + } + catch(java.sql.SQLException e) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + e.printStackTrace(pw); + pw.flush(); + _logger.warning("ConnectionPool: database connection failed:\n" + sw.toString()); + } + } + if(_trace) + { + _logger.trace("ConnectionPool", "returning connection: " + conn + " " + + _connections.size() + "/" + _nconnections + " remaining"); + } + return conn; + } + + public synchronized void + release(java.sql.Connection connection) + { + if(connection != null) + { + _connections.add(connection); + notifyAll(); + } + } + + ConnectionPool(Ice.Logger logger, String url, String username, String password, int numConnections) + throws java.sql.SQLException + { + _logger = logger; + _url = url; + _username = username; + _password = password; + + _nconnections = numConnections; + if(_trace) + { + _logger.trace("ConnectionPool", "establishing " + numConnections + " connections to " + url); + } + while(numConnections-- > 0) + { + java.sql.Connection connection = java.sql.DriverManager.getConnection(url, username, password); + connection.setAutoCommit(false); + _connections.add(connection); + } + } + + + private Ice.Logger _logger; + private boolean _trace = true; + private String _url; + private String _username; + private String _password; + private java.util.LinkedList<java.sql.Connection> _connections = new java.util.LinkedList<java.sql.Connection>(); + private boolean _destroyed = false; + private int _nconnections; +} diff --git a/java/demo/Database/library/DispatchInterceptorI.java b/java/demo/Database/library/DispatchInterceptorI.java new file mode 100644 index 00000000000..e92c9e6e73e --- /dev/null +++ b/java/demo/Database/library/DispatchInterceptorI.java @@ -0,0 +1,58 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class DispatchInterceptorI extends Ice.DispatchInterceptor +{ + public Ice.DispatchStatus + dispatch(Ice.Request request) + { + // Allocate a new SQLRequestContext associated with this + // request thread. + SQLRequestContext context = new SQLRequestContext(); + try + { + Ice.DispatchStatus status = _servant.ice_dispatch(request, null); + + // An exception causes the current transaction to rollback. + context.destroyFromDispatch(status == Ice.DispatchStatus.DispatchOK); + + return status; + } + catch(JDBCException ex) + { + // Log the error. + Ice.Current c = request.getCurrent(); + context.error("call of `" + c.operation + "' on id `" + c.id.category + "/" + c.id.name + "' failed", ex); + + // A JDBCException causes the current transaction to + // rollback. + context.destroyFromDispatch(false); + + // Translate the exception to UnknownException. + Ice.UnknownException e = new Ice.UnknownException(); + e.initCause(ex); + throw e; + } + catch(RuntimeException ex) + { + // Any other exception causes the transaction to rollback. + context.destroyFromDispatch(false); + throw ex; + } + } + + DispatchInterceptorI(Ice.Object servant) + { + _servant = servant; + } + + private Ice.Object _servant; +} diff --git a/java/demo/Database/library/Glacier2Session.ice b/java/demo/Database/library/Glacier2Session.ice new file mode 100644 index 00000000000..5a9ab2dd252 --- /dev/null +++ b/java/demo/Database/library/Glacier2Session.ice @@ -0,0 +1,50 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef LIBRARY_GLACIER2_SESSION_ICE +#define LIBRARY_GLACIER2_SESSION_ICE + +#include <Glacier2/Session.ice> + +module Demo +{ + +/* Forward declaration. */ +interface Library; + +/** + * + * The session object. This is used to retrieve a per-session library + * on behalf of the client. If the session is not refreshed on a + * periodic basis, it will be automatically destroyed. + * + */ +interface Glacier2Session extends Glacier2::Session +{ + /** + * + * Get the library object. + * + * @return A proxy for the new library. + * + **/ + Library* getLibrary(); + + /** + * + * Refresh a session. If a session is not refreshed on a regular + * basis by the client, it will be automatically destroyed. + * + **/ + idempotent void refresh(); +}; + +}; + +#endif diff --git a/java/demo/Database/library/Glacier2SessionManagerI.java b/java/demo/Database/library/Glacier2SessionManagerI.java new file mode 100644 index 00000000000..059d923de54 --- /dev/null +++ b/java/demo/Database/library/Glacier2SessionManagerI.java @@ -0,0 +1,38 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class Glacier2SessionManagerI extends Glacier2._SessionManagerDisp +{ + public Glacier2.SessionPrx + create(String userId, Glacier2.SessionControlPrx control, Ice.Current c) + { + SessionI session = new SessionI(_logger, c.adapter); + _Glacier2SessionTie servant = new _Glacier2SessionTie(session); + + Glacier2.SessionPrx proxy = Glacier2.SessionPrxHelper.uncheckedCast(c.adapter.addWithUUID(servant)); + + _logger.trace("SessionFactory", "create new session: " + + c.adapter.getCommunicator().identityToString(proxy.ice_getIdentity())); + + _reaper.add(proxy, session); + + return proxy; + } + + Glacier2SessionManagerI(Ice.Logger logger, ReapThread reaper) + { + _logger = logger; + _reaper = reaper; + } + + private Ice.Logger _logger; + private ReapThread _reaper; +} diff --git a/java/demo/Database/library/Grammar.java b/java/demo/Database/library/Grammar.java new file mode 100644 index 00000000000..5bf6a22cf95 --- /dev/null +++ b/java/demo/Database/library/Grammar.java @@ -0,0 +1,176 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +class Grammar +{ + Grammar(Parser p) + { + _parser = p; + _scanner = new Scanner(_parser); + } + + void + parse() + { + while(true) + { + try + { + _token = _scanner.nextToken(); + if(_token == null) + { + return; + } + else if(_token.type == Token.TOK_SEMI) + { + // Continue + } + else if(_token.type == Token.TOK_HELP) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + + _parser.usage(); + } + else if(_token.type == Token.TOK_EXIT) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + + return; + } + else if(_token.type == Token.TOK_ADD_BOOK) + { + java.util.List s = strings(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.addBook(s); + } + else if(_token.type == Token.TOK_FIND_ISBN) + { + java.util.List s = strings(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.findIsbn(s); + } + else if(_token.type == Token.TOK_FIND_AUTHORS) + { + java.util.List s = strings(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.findAuthors(s); + } + else if(_token.type == Token.TOK_FIND_TITLE) + { + java.util.List s = strings(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.findTitle(s); + } + else if(_token.type == Token.TOK_NEXT_FOUND_BOOK) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + + _parser.nextFoundBook(); + } + else if(_token.type == Token.TOK_PRINT_CURRENT) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + + _parser.printCurrent(); + } + else if(_token.type == Token.TOK_RENT_BOOK) + { + java.util.List s = strings(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.rentCurrent(s); + } + else if(_token.type == Token.TOK_RETURN_BOOK) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + _parser.returnCurrent(); + } + else if(_token.type == Token.TOK_REMOVE_CURRENT) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_SEMI) + { + throw new ParseError("Expected ';'"); + } + + _parser.removeCurrent(); + } + else + { + _parser.error("parse error"); + } + } + catch(ParseError e) + { + _parser.error("Parse error: " + e.getMessage()); + } + } + } + + private java.util.List + strings() + { + java.util.List l = new java.util.ArrayList(); + while(true) + { + _token = _scanner.nextToken(); + if(_token.type != Token.TOK_STRING) + { + return l; + } + l.add(_token.value); + } + } + + static private class ParseError extends RuntimeException + { + ParseError(String msg) + { + super(msg); + } + } + + private Parser _parser; + private Scanner _scanner; + private Token _token; +} diff --git a/java/demo/Database/library/Library.ice b/java/demo/Database/library/Library.ice new file mode 100644 index 00000000000..a26dbe20b01 --- /dev/null +++ b/java/demo/Database/library/Library.ice @@ -0,0 +1,288 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef LIBRARY_ICE +#define LIBRARY_ICE + +#include <Ice/BuiltinSequences.ice> + +module Demo +{ + +/** + * + * This local exception is used internally if a java.sql.SQLException + * is raised. + * + **/ +local exception JDBCException +{ +}; + +/** + * + * This exception is raised if the book already exists. + * + **/ +exception BookExistsException +{ +}; + +/** + * + * This exception is raised if a book has already been rented. + * + **/ +exception BookRentedException +{ + string renter; +}; + +/** + * + * This exception is raised if a customer name is invalid. + * + **/ +exception InvalidCustomerException +{ +}; + +/** + * + * This exception is raised if the book has not been rented. + * + **/ +exception BookNotRentedException +{ +}; + +/** Forward declaration for the interface Book. */ +interface Book; + +/** + * + * A description of a book. + * + **/ +struct BookDescription +{ + /** The ISBN number of the book. */ + string isbn; + + /** The title of the book. */ + string title; + + /** The authors of the book. */ + ["java:type:java.util.LinkedList<String>:java.util.List<String>"] Ice::StringSeq authors; + + /** The customer name of the renter. */ + string rentedBy; + + /** A proxy to the associated book. */ + Book* proxy; +}; + +/** A sequence of book descriptions. */ +["java:type:java.util.LinkedList<BookDescription>:java.util.List<BookDescription>"] +sequence<BookDescription> BookDescriptionSeq; + +/** + * + * This interface represents a book. + * + **/ +interface Book +{ + /** + * + * Get a description of the book. + * + * @return The book description. + * + **/ + idempotent BookDescription describe(); + + /** + * + * Set the title of a book. + * + * @param title The book title. + * + **/ + void setTitle(string title); + + /** + * + * Set the book authors. + * + * @param authors The book authors. + * + **/ + void setAuthors(["java:type:java.util.LinkedList<String>:java.util.List<String>"] Ice::StringSeq authors); + + /** + * + * Rent the book to the specified customer. + * + * @param customer The customer. + * + * @throws BookRentedException Raised if the book has already been + * rented. + * + * @throws InvalidCustomerException Raised if the customer is invalid. + * + **/ + void rentBook(string name) + throws InvalidCustomerException, BookRentedException; + + /** + * + * Get the renter. + * + * @return The current rental customer. + * + * @throws BookNotRentedException Raised if the book is not + * currently rented. + * + **/ + idempotent string getRenter() + throws BookNotRentedException; + + /** + * + * Return the book. + * + * @throws BookNotRentedException Raised if the book is not + * currently rented. + * + **/ + void returnBook() + throws BookNotRentedException; + + /** + * + * Destroy the book. + * + **/ + void destroy(); +}; + +/** + * + * Interface to get query results. + * + **/ +interface BookQueryResult +{ + /** + * + * Get more query results. + * + * @param n The maximum number of results to return. + * + * @param destroyed There are no more results, and the query has + * been destroyed. + * + * @returns A sequence of up to n results. + * + **/ + BookDescriptionSeq next(int n, out bool destroyed); + + /** + * + * Destroy the query result. + * + **/ + void destroy(); +}; + +/** + * + * An interface to the library. + * + **/ +interface Library +{ + /** + * + * Query based on isbn number. The query is a partial match at the + * start of the isbn number. + * + * @param isbn The ISBN number. + * + * @param n The number of rows to retrieve in the initial request. + + * @param first The first set of results, up to n results. + * + * @param nrows The total number of rows. + * + * @param result The remainder of the results. If there are no + * further results, a null proxy is returned. + * + **/ + void queryByIsbn(string isbn, int n, out BookDescriptionSeq first, out int nrows, out BookQueryResult* result); + + /** + * + * Query based on the author name. The query is a partial match of + * the author's name. + * + * @param author The authors name. + * + * @param n The number of rows to retrieve in the initial request. + + * @param first The first set of results, up to n results. + * + * @param nrows The total number of rows. + * + * @param result The remainder of the results. If there are no + * further results, a null proxy is returned. + * + **/ + void queryByAuthor(string author, int n, out BookDescriptionSeq first, out int nrows, out BookQueryResult* result); + + /** + * + * Query based on the book title. The query is a partial match of + * the book title. + * + * @param author The authors name. + * + * @param n The number of rows to retrieve in the initial request. + + * @param first The first set of results, up to n results. + * + * @param nrows The total number of rows. + * + * @param result The remainder of the results. If there are no + * further results, a null proxy is returned. + * + **/ + void queryByTitle(string title, int n, out BookDescriptionSeq first, out int nrows, out BookQueryResult* result); + + /** + * + * Create a book with the given description. + * + * @param description The book description. + * + * @return A proxy for the new book. + * + * @throws BookExistsException Raised if a book with the same ISBN + * number already exists. + * + **/ + Book* createBook(string isbn, string title, + ["java:type:java.util.LinkedList<String>:java.util.List<String>"] Ice::StringSeq authors) + throws BookExistsException; +}; + +}; + +#endif diff --git a/java/demo/Database/library/LibraryI.java b/java/demo/Database/library/LibraryI.java new file mode 100644 index 00000000000..81bae5c6de7 --- /dev/null +++ b/java/demo/Database/library/LibraryI.java @@ -0,0 +1,387 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +// +// This is a per-session library object. +// +class LibraryI extends _LibraryDisp +{ + public void + queryByIsbn(String isbn, int n, BookDescriptionSeqHolder first, Ice.IntHolder nrows, + BookQueryResultPrxHolder result, Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + + reapQueries(); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT COUNT(*) FROM books WHERE isbn LIKE ?"); + stmt.setString(1, isbn + "%"); + java.sql.ResultSet rs = stmt.executeQuery(); + boolean next = rs.next(); + assert next; + nrows.value = rs.getInt(1); + if(nrows.value == 0) + { + return; + } + + stmt = context.prepareStatement("SELECT * FROM books WHERE isbn LIKE ?"); + stmt.setString(1, isbn + "%"); + rs = stmt.executeQuery(); + next = rs.next(); + assert next; + + first.value = new java.util.LinkedList<BookDescription>(); + next = true; + for(int i = 0; i < n && next; ++i) + { + first.value.add(BookI.extractDescription(context, rs, current.adapter)); + next = rs.next(); + } + if(next) + { + // The SQLRequestContext is now owned by the query + // implementation. + context.obtain(); + BookQueryResultI impl = new BookQueryResultI(context, rs); + result.value = BookQueryResultPrxHelper.uncheckedCast(current.adapter.addWithUUID(impl)); + add(result.value, impl); + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + queryByAuthor(String author, int n, BookDescriptionSeqHolder first, Ice.IntHolder nrows, + BookQueryResultPrxHolder result, Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + + reapQueries(); + + try + { + // Find each of the authors. + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM authors WHERE name LIKE ?"); + stmt.setString(1, "%" + author + "%"); + java.sql.ResultSet rs = stmt.executeQuery(); + if(!rs.next()) + { + // No results are available. + nrows.value = 0; + return; + } + + // Build a query that finds all books by these authors. + StringBuffer sb = new StringBuffer("("); + boolean front = true; + do + { + if(!front) + { + sb.append(" OR "); + } + front = false; + sb.append("authors_books.author_id="); + sb.append(rs.getInt("id")); + } + while(rs.next()); + sb.append(")"); + + stmt = context.prepareStatement( + "SELECT COUNT(DISTINCT ID) FROM books INNER JOIN authors_books ON books.id=authors_books.book_id AND " + + sb.toString()); + rs = stmt.executeQuery(); + boolean next = rs.next(); + assert next; + nrows.value = rs.getInt(1); + if(nrows.value == 0) + { + return; + } + + // Execute the query. + stmt = context.prepareStatement( + "SELECT DISTINCT ID, ISBN, TITLE, RENTER_ID FROM books INNER JOIN authors_books ON " + + "books.id=authors_books.book_id AND " + sb.toString()); + rs = stmt.executeQuery(); + next = rs.next(); + assert next; + + next = true; + first.value = new java.util.LinkedList<BookDescription>(); + for(int i = 0; i < n && next; ++i) + { + first.value.add(BookI.extractDescription(context, rs, current.adapter)); + next = rs.next(); + } + if(next) + { + // The SQLRequestContext is now owned by the query + // implementation. + context.obtain(); + BookQueryResultI impl = new BookQueryResultI(context, rs); + result.value = BookQueryResultPrxHelper.uncheckedCast(current.adapter.addWithUUID(impl)); + add(result.value, impl); + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public void + queryByTitle(String title, int n, BookDescriptionSeqHolder first, Ice.IntHolder nrows, + BookQueryResultPrxHolder result, Ice.Current current) + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + + reapQueries(); + + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT COUNT(*) FROM books WHERE title LIKE ?"); + stmt.setString(1, "%" + title + "%"); + java.sql.ResultSet rs = stmt.executeQuery(); + boolean next = rs.next(); + assert next; + nrows.value = rs.getInt(1); + if(nrows.value == 0) + { + return; + } + + stmt = context.prepareStatement("SELECT * FROM books WHERE title LIKE ?"); + stmt.setString(1, "%" + title + "%"); + rs = stmt.executeQuery(); + next = rs.next(); + assert next; + + first.value = new java.util.LinkedList<BookDescription>(); + next = true; + for(int i = 0; i < n && next; ++i) + { + first.value.add(BookI.extractDescription(context, rs, current.adapter)); + next = rs.next(); + } + if(next) + { + // The SQLRequestContext is now owned by the query + // implementation. + context.obtain(); + BookQueryResultI impl = new BookQueryResultI(context, rs); + result.value = BookQueryResultPrxHelper.uncheckedCast(current.adapter.addWithUUID(impl)); + add(result.value, impl); + } + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + public BookPrx + createBook(String isbn, String title, java.util.List<String> authors, Ice.Current current) + throws BookExistsException + { + SQLRequestContext context = SQLRequestContext.getCurrentContext(); + assert context != null; + try + { + java.sql.PreparedStatement stmt = context.prepareStatement("SELECT * FROM books WHERE isbn = ?"); + stmt.setString(1, isbn); + java.sql.ResultSet rs = stmt.executeQuery(); + if(rs.next()) + { + throw new BookExistsException(); + } + + // + // First convert the authors string to an id set. + // + java.util.List<Integer> authIds = new java.util.LinkedList<Integer>(); + java.util.Iterator<String> p = authors.iterator(); + while(p.hasNext()) + { + String author = p.next(); + + Integer id; + stmt = context.prepareStatement("SELECT * FROM authors WHERE name = ?"); + stmt.setString(1, author); + rs = stmt.executeQuery(); + if(rs.next()) + { + // If there is a result, then the database + // already contains this author. + id = rs.getInt(1); + assert !rs.next(); + } + else + { + // Otherwise, create a new author record. + stmt = context.prepareStatement("INSERT INTO authors (name) VALUES(?)", + java.sql.Statement.RETURN_GENERATED_KEYS); + stmt.setString(1, author); + int count = stmt.executeUpdate(); + assert count == 1; + rs = stmt.getGeneratedKeys(); + boolean next = rs.next(); + assert next; + id = rs.getInt(1); + } + + // Add the new id to the list of ids. + authIds.add(id); + } + + // Create the new book. + stmt = context.prepareStatement("INSERT INTO books (isbn, title) VALUES(?, ?)", + java.sql.Statement.RETURN_GENERATED_KEYS); + stmt.setString(1, isbn); + stmt.setString(2, title); + int count = stmt.executeUpdate(); + assert count == 1; + + rs = stmt.getGeneratedKeys(); + boolean next = rs.next(); + assert next; + Integer bookId = rs.getInt(1); + + // Create new authors_books records. + java.util.Iterator<Integer> q = authIds.iterator(); + while(q.hasNext()) + { + stmt = context.prepareStatement("INSERT INTO authors_books (book_id, author_id) VALUES(?, ?)"); + stmt.setInt(1, bookId); + stmt.setInt(2, q.next()); + count = stmt.executeUpdate(); + assert count == 1; + } + + return BookPrxHelper.uncheckedCast(current.adapter.createProxy(BookI.createIdentity(bookId))); + } + catch(java.sql.SQLException e) + { + JDBCException ex = new JDBCException(); + ex.initCause(e); + throw ex; + } + } + + LibraryI() + { + } + + synchronized public void + destroy() + { + if(_destroyed) + { + return; + } + _destroyed = true; + java.util.Iterator<QueryProxyPair> p = _queries.iterator(); + while(p.hasNext()) + { + try + { + p.next().proxy.destroy(); + } + catch(Ice.ObjectNotExistException e) + { + // Ignore, it could have already been destroyed. + } + } + } + + synchronized public void + shutdown() + { + if(_destroyed) + { + return; + } + _destroyed = true; + + // Shutdown each of the associated query objects. + java.util.Iterator<QueryProxyPair> p = _queries.iterator(); + while(p.hasNext()) + { + p.next().impl.shutdown(); + } + } + + synchronized private void + add(BookQueryResultPrx proxy, BookQueryResultI impl) + { + // If the session has been destroyed, then destroy the book + // result, and raise an ObjectNotExistException. + if(_destroyed) + { + proxy.destroy(); + throw new Ice.ObjectNotExistException(); + } + _queries.add(new QueryProxyPair(proxy, impl)); + } + + synchronized private void + reapQueries() + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + + java.util.Iterator<QueryProxyPair> p = _queries.iterator(); + while(p.hasNext()) + { + QueryProxyPair pair = p.next(); + try + { + pair.proxy.ice_ping(); + } + catch(Ice.ObjectNotExistException e) + { + p.remove(); + } + } + } + + static class QueryProxyPair + { + QueryProxyPair(BookQueryResultPrx p, BookQueryResultI i) + { + proxy = p; + impl = i; + } + + BookQueryResultPrx proxy; + BookQueryResultI impl; + } + + private java.util.List<QueryProxyPair> _queries = new java.util.LinkedList<QueryProxyPair>(); + private boolean _destroyed = false; +} diff --git a/java/demo/Database/library/Parser.java b/java/demo/Database/library/Parser.java new file mode 100644 index 00000000000..2b2b8cb71fd --- /dev/null +++ b/java/demo/Database/library/Parser.java @@ -0,0 +1,443 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class Parser +{ + Parser(Ice.Communicator communicator, LibraryPrx library) + { + _library = library; + } + + void + usage() + { + System.err.print( + "help Print this message.\n" + + "exit, quit Exit this program.\n" + + "add isbn title authors Create new book.\n" + + "isbn NUMBER Find all books that start with the given ISBN number.\n" + + "authors NAME Find all books by the given authors.\n" + + "title NAME Find all books which have the given title.\n" + + "next Set the current book to the next one that was found.\n" + + "current Display the current book.\n" + + "rent NAME Rent the current book for customer NAME.\n" + + "return Return the currently rented book.\n" + + "remove Permanently remove the current book from the library.\n"); + } + + void + addBook(java.util.List args) + { + if(args.size() != 3) + { + error("`add' requires exactly three arguments (type `help' for more info)"); + return; + } + + try + { + String isbn = (String)args.get(0); + String title = (String)args.get(1); + + java.util.List<String> authors = new java.util.LinkedList<String>(); + java.util.StringTokenizer st = new java.util.StringTokenizer((String)args.get(2), ","); + while(st.hasMoreTokens()) + { + authors.add(st.nextToken().trim()); + } + + BookPrx book = _library.createBook(isbn, title, authors); + System.out.println("added new book with isbn " + isbn); + } + catch(BookExistsException ex) + { + error("the book already exists"); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + findIsbn(java.util.List args) + { + if(args.size() != 1) + { + error("`isbn' requires exactly one argument (type `help' for more info)"); + return; + } + + try + { + if(_query != null) + { + try + { + _query.destroy(); + } + catch(Exception e) + { + // Ignore + } + _query = null; + _current = null; + } + + BookDescriptionSeqHolder first = new BookDescriptionSeqHolder(); + Ice.IntHolder nrows = new Ice.IntHolder(); + BookQueryResultPrxHolder result = new BookQueryResultPrxHolder(); + _library.queryByIsbn((String)args.get(0), 1, first, nrows, result); + + System.out.println(nrows.value + " results"); + if(nrows.value == 0) + { + return; + } + + _current = first.value.get(0); + _query = result.value; + printCurrent(); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + findAuthors(java.util.List args) + { + if(args.size() != 1) + { + error("`authors' requires exactly one argument (type `help' for more info)"); + return; + } + + try + { + if(_query != null) + { + try + { + _query.destroy(); + } + catch(Exception e) + { + // Ignore + } + _query = null; + _current = null; + } + + BookDescriptionSeqHolder first = new BookDescriptionSeqHolder(); + Ice.IntHolder nrows = new Ice.IntHolder(); + BookQueryResultPrxHolder result = new BookQueryResultPrxHolder(); + _library.queryByAuthor((String)args.get(0), 1, first, nrows, result); + + System.out.println(nrows.value + " results"); + if(nrows.value == 0) + { + return; + } + + _current = first.value.get(0); + _query = result.value; + printCurrent(); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + findTitle(java.util.List args) + { + if(args.size() != 1) + { + error("`title' requires exactly one argument (type `help' for more info)"); + return; + } + + try + { + if(_query != null) + { + try + { + _query.destroy(); + } + catch(Exception e) + { + // Ignore + } + _query = null; + _current = null; + } + + BookDescriptionSeqHolder first = new BookDescriptionSeqHolder(); + Ice.IntHolder nrows = new Ice.IntHolder(); + BookQueryResultPrxHolder result = new BookQueryResultPrxHolder(); + _library.queryByTitle((String)args.get(0), 1, first, nrows, result); + + System.out.println(nrows.value + " results"); + if(nrows.value == 0) + { + return; + } + + _current = first.value.get(0); + _query = result.value; + printCurrent(); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + nextFoundBook() + { + if(_query == null) + { + System.out.println("no next book"); + return; + } + + try + { + Ice.BooleanHolder destroyed = new Ice.BooleanHolder(); + java.util.List<BookDescription> next = _query.next(1, destroyed); + if(next.size() > 0) + { + _current = next.get(0); + } + else + { + assert destroyed.value; + _current = null; + } + if(destroyed.value) + { + _query = null; + } + printCurrent(); + } + catch(Ice.ObjectNotExistException ex) + { + System.out.println("the query object no longer exists"); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + printCurrent() + { + if(_current != null) + { + System.out.println("current book is:"); + System.out.println("isbn: " + _current.isbn); + System.out.println("title: " + _current.title); + System.out.println("authors: " + _current.authors); + if(_current.rentedBy.length() > 0) + { + System.out.println("rented: " + _current.rentedBy); + } + } + else + { + System.out.println("no current book"); + } + } + + void + rentCurrent(java.util.List args) + { + if(args.size() != 1) + { + error("`rent' requires exactly one argument (type `help' for more info)"); + return; + } + + try + { + if(_current != null) + { + _current.proxy.rentBook((String)args.get(0)); + System.out.println("the book is now rented by `" + (String)args.get(0) + "'"); + _current = _current.proxy.describe(); + } + else + { + System.out.println("no current book"); + } + } + catch(BookRentedException ex) + { + System.out.println("the book has already been rented"); + } + catch(InvalidCustomerException ex) + { + System.out.println("the customer name is invalid"); + } + catch(Ice.ObjectNotExistException ex) + { + System.out.println("current book no longer exists"); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + returnCurrent() + { + try + { + if(_current != null) + { + _current.proxy.returnBook(); + System.out.println( "the book has been returned"); + _current = _current.proxy.describe(); + } + else + { + System.out.println("no current book"); + } + } + catch(BookNotRentedException ex) + { + System.out.println("the book is not currently rented"); + } + catch(Ice.ObjectNotExistException ex) + { + System.out.println("current book no longer exists"); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + removeCurrent() + { + try + { + if(_current != null) + { + _current.proxy.destroy(); + _current = null; + System.out.println("removed current book" ); + } + else + { + System.out.println("no current book" ); + } + } + catch(Ice.ObjectNotExistException ex) + { + System.out.println("current book no longer exists"); + } + catch(Ice.LocalException ex) + { + error(ex.toString()); + } + } + + void + error(String s) + { + System.err.println("error: " + s); + } + + void + warning(String s) + { + System.err.println("warning: " + s); + } + + String + getInput() + { + System.out.print(">>> "); + System.out.flush(); + + try + { + return _in.readLine(); + } + catch(java.io.IOException e) + { + return null; + } + } + + int + parse() + { + _query = null; + _current = null; + + _in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); + + Grammar g = new Grammar(this); + g.parse(); + + return 0; + } + + int + parse(String file) + { + _query = null; + _current = null; + + try + { + _in = new java.io.BufferedReader(new java.io.FileReader(file)); + } + catch(java.io.FileNotFoundException ex) + { + error(ex.getMessage()); + return 1; + } + + Grammar g = new Grammar(this); + g.parse(); + + System.out.println(); + + try + { + _in.close(); + } + catch(java.io.IOException ex) + { + } + + return 0; + } + + private BookQueryResultPrx _query; + private BookDescription _current; + + private LibraryPrx _library; + + private java.io.BufferedReader _in; + private boolean _interactive; +} diff --git a/java/demo/Database/library/README b/java/demo/Database/library/README new file mode 100644 index 00000000000..b7e44a0dbdb --- /dev/null +++ b/java/demo/Database/library/README @@ -0,0 +1,103 @@ +MySQL JDBC Demo +=============== + +This demo shows how to implement an Ice server that uses mysql through +a JDBC API and demonstrates the following techniques: + + - Mapping relational data to Ice objects, and in particular the + conversion between Ice and JDBC types. + - Using a JDBC connection pool to provide JDBC connections for Ice + requests. + - Using an Ice servant locator. + - Using a dispatch interceptor. + + +Building the demo +----------------- + +1. Install mysql if necessary. + +2. Download version 5.0.8 of the mysql JDBC connector here: + + http://dev.mysql.com/downloads/connector/j/5.0.html + + After extracting the archive, add mysql-connector-java-5.0.8-bin.jar + to your CLASSPATH. + +3. Create a database named "library" and grant privileges to a user. In + the commands below, replace USER with the name you have chosen and + PASSWORD with a suitable password: + + $ mysql -u root -p + Enter password: + Welcome to the MySQL monitor. + + mysql> CREATE DATABASE library; + Query OK, 1 row affected (0.00 sec) + + mysql> GRANT ALL PRIVILEGES ON library.* TO "USER"@"localhost" + -> IDENTIFIED BY "PASSWORD"; + Query OK, 0 rows affected (0.00 sec) + + mysql> FLUSH PRIVILEGES; + Query OK, 0 rows affected (0.01 sec) + + mysql> EXIT + +4. Create the SQL tables using the script createTypes.sql: + + $ mysql --user=USER --pass=PASSWORD library < createTypes.sql + +5. Edit the JDBC properties in config.server to reflect your selected + user name and password: + + JDBC.Username=USER + JDBC.Password=PASSWORD + +NOTE: The instructions assume that the demo server runs on the same + host as the mysql server. If you intend to run the demo server on + a different host than the mysql server, you will need to revise + the mysql privileges as well as the JDBC URL in config.server. + + +Running the demo +---------------- + +To run the demo, first start the server: + +$ java Server + +The demo includes a text file named "books" containing a series of +commands that populate the server's database with a collection of +books. Pass this file as an argument the first time you run the +client. In another window: + +$ java Client books + +Type "help" to get a list of valid commands. + + +Running the demo with Glacier2 +------------------------------ + +The demo also supports a Glacier2 deployment. You will need to edit +config.client and uncomment these configuration parameters: + +#Ice.Default.Router=DemoGlacier2/router:ssl -p 4064 -h 127.0.0.1 +#Ice.ACM.Client=0 +#Ice.RetryIntervals=-1 + +To run the demo using Glacier2, first start the server: + +$ java Server + +In a separate window, start the Glacier2 router: + +$ glacier2router --Ice.Config=config.glacier2 + +In a separate window, start the client: + +$ java Client books + +Omit the "books" argument if you have already populated the server's +database. diff --git a/java/demo/Database/library/ReapThread.java b/java/demo/Database/library/ReapThread.java new file mode 100644 index 00000000000..b44a79b6e8b --- /dev/null +++ b/java/demo/Database/library/ReapThread.java @@ -0,0 +1,127 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class ReapThread extends Thread +{ + static class SessionProxyPair + { + SessionProxyPair(Demo.SessionPrx p, SessionI s) + { + glacier2proxy = null; + proxy = p; + session = s; + } + + SessionProxyPair(Glacier2.SessionPrx p, SessionI s) + { + glacier2proxy = p; + proxy = null; + session = s; + } + + Glacier2.SessionPrx glacier2proxy; + Demo.SessionPrx proxy; + SessionI session; + } + + ReapThread(Ice.Logger logger, long timeout) + { + _logger = logger; + _timeout = timeout; + } + + synchronized public void + run() + { + while(!_terminated) + { + try + { + wait((_timeout / 2) * 1000); + } + catch(InterruptedException e) + { + } + + if(!_terminated) + { + java.util.Iterator<SessionProxyPair> p = _sessions.iterator(); + while(p.hasNext()) + { + SessionProxyPair s = p.next(); + try + { + // + // Session destruction may take time in a + // real-world example. Therefore the current time + // is computed for each iteration. + // + if((System.currentTimeMillis() - s.session.timestamp()) > _timeout * 1000) + { + _logger.trace("ReapThread", "The session " + + s.proxy.ice_getCommunicator().identityToString(s.proxy.ice_getIdentity()) + + " has timed out."); + if(s.proxy != null) + { + s.proxy.destroy(); + } + else + { + s.glacier2proxy.destroy(); + } + p.remove(); + } + } + catch(Ice.ObjectNotExistException e) + { + p.remove(); + } + } + } + } + } + + synchronized public void + terminate() + { + _terminated = true; + notify(); + + // Destroy each of the sessions, releasing any resources they + // may hold. This calls directly on the session, not via the + // proxy since terminate() is called after the communicator is + // shutdown, which means calls on collocated objects are not + // permitted. + java.util.Iterator<SessionProxyPair> p = _sessions.iterator(); + while(p.hasNext()) + { + p.next().session.shutdown(); + } + _sessions.clear(); + } + + synchronized public void + add(SessionPrx proxy, SessionI session) + { + _sessions.add(new SessionProxyPair(proxy, session)); + } + + synchronized public void + add(Glacier2.SessionPrx proxy, SessionI session) + { + _sessions.add(new SessionProxyPair(proxy, session)); + } + + private final long _timeout; // Seconds. + private Ice.Logger _logger; + private boolean _terminated = false; + private java.util.List<SessionProxyPair> _sessions = new java.util.LinkedList<SessionProxyPair>(); +} diff --git a/java/demo/Database/library/RunParser.java b/java/demo/Database/library/RunParser.java new file mode 100644 index 00000000000..17a21db127e --- /dev/null +++ b/java/demo/Database/library/RunParser.java @@ -0,0 +1,216 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class RunParser +{ + // + // Adapter for the two types of session objects. + // + interface SessionAdapter + { + public LibraryPrx getLibrary(); + public void destroy(); + public void refresh(); + } + + static private class SessionRefreshThread extends Thread + { + SessionRefreshThread(Ice.Logger logger, long timeout, SessionAdapter session) + { + _logger = logger; + _session = session; + _timeout = timeout; // seconds. + } + + synchronized public void + run() + { + while(!_terminated) + { + try + { + wait(_timeout * 1000); + } + catch(InterruptedException e) + { + } + if(!_terminated) + { + try + { + _session.refresh(); + } + catch(Ice.LocalException ex) + { + _logger.warning("SessionRefreshThread: " + ex); + _terminated = true; + } + } + } + } + + synchronized private void + terminate() + { + _terminated = true; + notify(); + } + + final private Ice.Logger _logger; + final private SessionAdapter _session; + final private long _timeout; + private boolean _terminated = false; + } + + static int + runParser(String appName, String[] args, Ice.Communicator communicator) + { + SessionAdapter session; + final Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.uncheckedCast(communicator.getDefaultRouter()); + long timeout; + if(router != null) + { + Glacier2.SessionPrx glacier2session = null; + java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); + while(true) + { + System.out.println("This demo accepts any user-id / password combination."); + + try + { + String id; + System.out.print("user id: "); + System.out.flush(); + id = in.readLine(); + + String pw; + System.out.print("password: "); + System.out.flush(); + pw = in.readLine(); + + try + { + glacier2session = router.createSession(id, pw); + timeout = router.getSessionTimeout() / 2; + break; + } + catch(Glacier2.PermissionDeniedException ex) + { + System.out.println("permission denied:\n" + ex.reason); + } + catch(Glacier2.CannotCreateSessionException ex) + { + System.out.println("cannot create session:\n" + ex.reason); + } + } + catch(java.io.IOException ex) + { + ex.printStackTrace(); + } + } + final Glacier2SessionPrx sess = Glacier2SessionPrxHelper.uncheckedCast(glacier2session); + session = new SessionAdapter() + { + public LibraryPrx getLibrary() + { + return sess.getLibrary(); + } + + public void destroy() + { + try + { + router.destroySession(); + } + catch(Glacier2.SessionNotExistException ex) + { + } + catch(Ice.ConnectionLostException ex) + { + // + // Expected: the router closed the connection. + // + } + } + + public void refresh() + { + sess.refresh(); + } + }; + } + else + { + SessionFactoryPrx factory = SessionFactoryPrxHelper.checkedCast( + communicator.propertyToProxy("SessionFactory.Proxy")); + if(factory == null) + { + System.err.println(appName + ": invalid object reference"); + return 1; + } + + final SessionPrx sess = factory.create(); + session = new SessionAdapter() + { + public LibraryPrx getLibrary() + { + return sess.getLibrary(); + } + + public void destroy() + { + sess.destroy(); + } + + public void refresh() + { + sess.refresh(); + } + }; + timeout = factory.getSessionTimeout()/2; + } + SessionRefreshThread refresh = new SessionRefreshThread(communicator.getLogger(), timeout, session); + refresh.start(); + + LibraryPrx library = session.getLibrary(); + + Parser parser = new Parser(communicator, library); + + int rc = 0; + + if(args.length == 1) + { + rc = parser.parse(args[0]); + } + + if(rc == 0) + { + rc = parser.parse(); + } + + if(refresh != null) + { + refresh.terminate(); + try + { + refresh.join(); + } + catch(InterruptedException e) + { + } + refresh = null; + } + + session.destroy(); + + return rc; + } +} diff --git a/java/demo/Database/library/SQLRequestContext.java b/java/demo/Database/library/SQLRequestContext.java new file mode 100644 index 00000000000..533e74be491 --- /dev/null +++ b/java/demo/Database/library/SQLRequestContext.java @@ -0,0 +1,181 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +// +// A SQL request context encapsulates SQL resources allocated in the +// process of executing a request, such as the database connection, +// and associated SQL statements. +// +// The request context is automatically destroyed at the end of a +// request, or if obtain is called it must be destroyed manually by +// calling destroy. +// +// When the request context is destroyed, the transaction is either +// automatically committed or rolled back, depending whether the +// request executed successfully. +// +class SQLRequestContext +{ + public static SQLRequestContext + getCurrentContext() + { + synchronized(_contextMap) + { + return _contextMap.get(Thread.currentThread()); + } + } + + public static void + initialize(Ice.Logger logger, ConnectionPool pool) + { + assert _logger == null; + assert _pool == null; + + _logger = logger; + _pool = pool; + } + + public java.sql.PreparedStatement + prepareStatement(String sql) + throws java.sql.SQLException + { + java.sql.PreparedStatement stmt = _conn.prepareStatement(sql); + _statements.add(stmt); + return stmt; + } + + public java.sql.PreparedStatement + prepareStatement(String sql, int autoGeneratedKeys) + throws java.sql.SQLException + { + java.sql.PreparedStatement stmt = _conn.prepareStatement(sql, autoGeneratedKeys); + _statements.add(stmt); + return stmt; + } + + // Called to obtain ownership of the context. The context is no + // longer destroyed automatically when the current request has + // completed. + public void + obtain() + { + if(_trace) + { + _logger.trace("SQLRequestContext", "obtain context: " + this + + " thread: " + Thread.currentThread()); + } + _obtain = true; + } + + public void + destroy(boolean commit) + { + // Must only be called on an obtained context. + assert _obtain; + destroyInternal(commit); + } + + public void + error(String prefix, Exception ex) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + ex.printStackTrace(pw); + pw.flush(); + _logger.error(prefix + ": error:\n" + sw.toString()); + } + + SQLRequestContext() + { + _conn = _pool.acquire(); + + synchronized(_contextMap) + { + if(_trace) + { + _logger.trace("SQLRequestContext", "create new context: " + this + + " thread: " + Thread.currentThread() + + ": connection: " + _conn); + } + + _contextMap.put(Thread.currentThread(), this); + } + } + + // Called only during the dispatch process. + void + destroyFromDispatch(boolean commit) + { + synchronized(_contextMap) + { + // Remove the current context from the thread->context + // map. + SQLRequestContext context = _contextMap.remove(Thread.currentThread()); + assert context != null; + } + + // If the context was obtained then don't destroy. + if(!_obtain) + { + destroyInternal(commit); + } + } + + private void + destroyInternal(boolean commit) + { + // Release all resources. + try + { + if(commit) + { + _conn.commit(); + if(_trace) + { + _logger.trace("SQLRequestContext", "commit context: " + this); + } + } + else + { + _conn.rollback(); + if(_trace) + { + _logger.trace("SQLRequestContext", "rollback context: " + this); + } + } + + java.util.Iterator<java.sql.Statement> p = _statements.iterator(); + while(p.hasNext()) + { + p.next().close(); + } + } + catch(java.sql.SQLException e) + { + error("SQLRequestContext", e); + } + + _pool.release(_conn); + + _statements.clear(); + _conn = null; + } + + // A map of threads to request contexts. + private static java.util.Map<Thread, SQLRequestContext> _contextMap = + new java.util.HashMap<Thread, SQLRequestContext>(); + + private static Ice.Logger _logger = null; + private static ConnectionPool _pool = null; + + private boolean _trace = true; + private java.util.List<java.sql.Statement> _statements = new java.util.LinkedList<java.sql.Statement>(); + private java.sql.Connection _conn; + private boolean _obtain = false; +} diff --git a/java/demo/Database/library/Scanner.java b/java/demo/Database/library/Scanner.java new file mode 100644 index 00000000000..879396725b4 --- /dev/null +++ b/java/demo/Database/library/Scanner.java @@ -0,0 +1,283 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +class Scanner +{ + Scanner(Parser p) + { + _parser = p; + } + + Token + nextToken() + { + String s = next(); + if(s == null) + { + return null; + } + + if(s.equals(";")) + { + return new Token(Token.TOK_SEMI); + } + else if(s.equals("help")) + { + return new Token(Token.TOK_HELP); + } + else if(s.equals("exit") || s.equals("quit")) + { + return new Token(Token.TOK_EXIT); + } + else if(s.equals("add")) + { + return new Token(Token.TOK_ADD_BOOK); + } + else if(s.equals("isbn")) + { + return new Token(Token.TOK_FIND_ISBN); + } + else if(s.equals("authors")) + { + return new Token(Token.TOK_FIND_AUTHORS); + } + else if(s.equals("title")) + { + return new Token(Token.TOK_FIND_TITLE); + } + else if(s.equals("next")) + { + return new Token(Token.TOK_NEXT_FOUND_BOOK); + } + else if(s.equals("current")) + { + return new Token(Token.TOK_PRINT_CURRENT); + } + else if(s.equals("rent")) + { + return new Token(Token.TOK_RENT_BOOK); + } + else if(s.equals("return")) + { + return new Token(Token.TOK_RETURN_BOOK); + } + else if(s.equals("remove")) + { + return new Token(Token.TOK_REMOVE_CURRENT); + } + else + { + return new Token(Token.TOK_STRING, s); + } + } + + static private class EndOfInput extends Exception + { + } + + private char + get() + throws EndOfInput + { + // + // If there is an character in the unget buffer, return it. + // + if(_unget) + { + _unget = false; + return _ungetChar; + } + + // + // No current buffer? + // + if(_buf == null) + { + _buf = _parser.getInput(); + _pos = 0; + if(_buf == null) + { + throw new EndOfInput(); + } + } + + // + // At the end-of-buffer? + // + while(_pos >= _buf.length()) + { + _buf = null; + _pos = 0; + return '\n'; + } + + return _buf.charAt(_pos++); + } + + // + // unget only works with one character. + // + private void + unget(char c) + { + assert(!_unget); + _unget = true; + _ungetChar = c; + } + + private String + next() + { + // + // Eat any whitespace. + // + char c; + try + { + do + { + c = get(); + } + while(Character.isWhitespace(c) && c != '\n'); + } + catch(EndOfInput ignore) + { + return null; + } + + StringBuffer buf = new StringBuffer(); + + if(c == ';' || c == '\n') + { + buf.append(';'); + } + else if(c == '\'') + { + try + { + while(true) + { + c = get(); + if(c == '\'') + { + break; + } + else + { + buf.append(c); + } + } + } + catch(EndOfInput e) + { + _parser.warning("EOF in string"); + } + } + else if(c == '\"') + { + try + { + while(true) + { + c = get(); + if(c == '\"') + { + break; + } + else if(c == '\\') + { + try + { + char next = get(); + switch(next) + { + case '\\': + case '"': + { + buf.append(next); + break; + } + + case 'n': + { + buf.append('\n'); + break; + } + + case 'r': + { + buf.append('\r'); + break; + } + + case 't': + { + buf.append('\t'); + break; + } + + case 'f': + { + buf.append('\f'); + break; + } + + default: + { + buf.append(c); + unget(next); + } + } + } + catch(EndOfInput e) + { + buf.append(c); + } + } + else + { + buf.append(c); + } + } + } + catch(EndOfInput e) + { + _parser.warning("EOF in string"); + } + } + else + { + // + // Otherwise it's a string. + // + try + { + do + { + buf.append(c); + c = get(); + } + while(!Character.isWhitespace(c) && c != ';' && c != '\n'); + + unget(c); + } + catch(EndOfInput ignore) + { + } + } + + return buf.toString(); + } + + private Parser _parser; + private boolean _unget = false; + private char _ungetChar; + private String _buf = null; + private int _pos; +} diff --git a/java/demo/Database/library/Server.java b/java/demo/Database/library/Server.java new file mode 100644 index 00000000000..b2e66386ffa --- /dev/null +++ b/java/demo/Database/library/Server.java @@ -0,0 +1,142 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class LibraryServer extends Ice.Application +{ + static class LocatorI implements Ice.ServantLocator + { + public Ice.Object + locate(Ice.Current c, Ice.LocalObjectHolder cookie) + { + assert c.id.category.equals("book"); + return _servant; + } + + public void + finished(Ice.Current c, Ice.Object servant, Object cookie) + { + } + + public void + deactivate(String category) + { + } + + LocatorI(Ice.Object servant) + { + _servant = new DispatchInterceptorI(servant); + } + + private Ice.Object _servant; + } + + public int + run(String[] args) + { + args = communicator().getProperties().parseCommandLineOptions("JDBC", args); + + if(args.length > 0) + { + System.err.println(appName() + ": too many arguments"); + return 1; + } + + Ice.Properties properties = communicator().getProperties(); + + String username = properties.getProperty("JDBC.Username"); + String password = properties.getProperty("JDBC.Password"); + String url = properties.getProperty("JDBC.Url"); + int nConnections = properties.getPropertyAsIntWithDefault("JDBC.NumConnections", 5); + if(nConnections < 1) + { + nConnections = 1; + } + ConnectionPool pool = null; + Ice.Logger logger = communicator().getLogger(); + + try + { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + } + catch(Exception e) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + e.printStackTrace(pw); + pw.flush(); + System.err.println("failed to initialize mysql driver:\n" + sw.toString()); + return 1; + } + + try + { + pool = new ConnectionPool(logger, url, username, password, nConnections); + } + catch(java.sql.SQLException e) + { + java.io.StringWriter sw = new java.io.StringWriter(); + java.io.PrintWriter pw = new java.io.PrintWriter(sw); + e.printStackTrace(pw); + pw.flush(); + System.err.println("failed to create connection pool: SQLException:\n" + sw.toString()); + return 1; + } + + long timeout = properties.getPropertyAsIntWithDefault("SessionTimeout", 30); + + ReapThread reaper = new ReapThread(logger, timeout); + reaper.start(); + + // + // Create an object adapter + // + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("SessionFactory"); + + SQLRequestContext.initialize(logger, pool); + adapter.addServantLocator(new LocatorI(new BookI()), "book"); + + adapter.add(new SessionFactoryI(logger, reaper, timeout), communicator().stringToIdentity("SessionFactory")); + adapter.add(new Glacier2SessionManagerI(logger, reaper), + communicator().stringToIdentity("LibrarySessionManager")); + + // + // Everything ok, let's go. + // + adapter.activate(); + + shutdownOnInterrupt(); + communicator().waitForShutdown(); + defaultInterrupt(); + + reaper.terminate(); + try + { + reaper.join(); + } + catch(InterruptedException e) + { + } + + pool.destroy(); + + return 0; + } +} + +public class Server +{ + static public void + main(String[] args) + { + LibraryServer app = new LibraryServer(); + app.main("demo.Database.library.Server", args, "config.server"); + } +} diff --git a/java/demo/Database/library/Session.ice b/java/demo/Database/library/Session.ice new file mode 100644 index 00000000000..5640227eb05 --- /dev/null +++ b/java/demo/Database/library/Session.ice @@ -0,0 +1,82 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef LIBRARY_SESSION_ICE +#define LIBRARY_SESSION_ICE + +module Demo +{ + +/* Forward declaration. */ +interface Library; + +/** + * + * The session object. This is used to retrieve a per-session library + * on behalf of the client. If the session is not refreshed on a + * periodic basis, it will be automatically destroyed. + * + */ +interface Session +{ + /** + * + * Get the library object. + * + * @return A proxy for the new library. + * + **/ + Library* getLibrary(); + + /** + * + * Refresh a session. If a session is not refreshed on a regular + * basis by the client, it will be automatically destroyed. + * + **/ + idempotent void refresh(); + + /** + * + * Destroy the session. + * + **/ + void destroy(); +}; + +/** + * + * Interface to create new sessions. + * + **/ +interface SessionFactory +{ + /** + * + * Create a session. + * + * @return A proxy to the session. + * + **/ + Session* create(); + + /** + * + * Get the value of the session timeout. Sessions are destroyed + * if they see no activity for this period of time. + * + * @return The timeout (in seconds). + * + **/ + ["nonmutating", "cpp:const"] idempotent long getSessionTimeout(); +}; + +}; + +#endif diff --git a/java/demo/Database/library/SessionFactoryI.java b/java/demo/Database/library/SessionFactoryI.java new file mode 100644 index 00000000000..31ab6716cd3 --- /dev/null +++ b/java/demo/Database/library/SessionFactoryI.java @@ -0,0 +1,46 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class SessionFactoryI extends _SessionFactoryDisp +{ + public synchronized SessionPrx + create(Ice.Current c) + { + SessionI session = new SessionI(_logger, c.adapter); + _SessionTie servant = new _SessionTie(session); + + SessionPrx proxy = SessionPrxHelper.uncheckedCast(c.adapter.addWithUUID(servant)); + + _logger.trace("SessionFactory", "create new session: " + + c.adapter.getCommunicator().identityToString(proxy.ice_getIdentity())); + + _reaper.add(proxy, session); + + return proxy; + } + + public long + getSessionTimeout(Ice.Current c) + { + return _timeout; + } + + SessionFactoryI(Ice.Logger logger, ReapThread reaper, long timeout) + { + _logger = logger; + _reaper = reaper; + _timeout = timeout; + } + + private Ice.Logger _logger; + private ReapThread _reaper; + private long _timeout; +} diff --git a/java/demo/Database/library/SessionI.java b/java/demo/Database/library/SessionI.java new file mode 100644 index 00000000000..6b213e9b0ab --- /dev/null +++ b/java/demo/Database/library/SessionI.java @@ -0,0 +1,96 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Demo.*; + +class SessionI implements _SessionOperations, _Glacier2SessionOperations +{ + synchronized public LibraryPrx + getLibrary(Ice.Current c) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + return _library; + } + + synchronized public void + refresh(Ice.Current c) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + _timestamp = System.currentTimeMillis(); + } + + synchronized public long + getSessionTimeout(Ice.Current c) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + return 5000; + } + + synchronized public void + destroy(Ice.Current c) + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + + _destroyed = true; + _logger.trace("Session", "session " + c.adapter.getCommunicator().identityToString(c.id) + + " is now destroyed."); + + // This method is never called on shutdown of the server. + _libraryI.destroy(); + c.adapter.remove(_library.ice_getIdentity()); + c.adapter.remove(c.id); + } + + // Called on application shutdown. + synchronized public void + shutdown() + { + if(!_destroyed) + { + _destroyed = true; + _libraryI.shutdown(); + } + } + + synchronized public long + timestamp() + { + if(_destroyed) + { + throw new Ice.ObjectNotExistException(); + } + return _timestamp; + } + + SessionI(Ice.Logger logger, Ice.ObjectAdapter adapter) + { + _logger = logger; + _timestamp = System.currentTimeMillis(); + _libraryI = new LibraryI(); + _library = LibraryPrxHelper.uncheckedCast(adapter.addWithUUID(new DispatchInterceptorI(_libraryI))); + } + + private Ice.Logger _logger; + private boolean _destroyed = false; // true if destroy() was called, false otherwise. + private long _timestamp; // The last time the session was refreshed. + private LibraryPrx _library; + private LibraryI _libraryI; +} diff --git a/java/demo/Database/library/Token.java b/java/demo/Database/library/Token.java new file mode 100644 index 00000000000..348edff9b58 --- /dev/null +++ b/java/demo/Database/library/Token.java @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +class Token +{ + public static final int TOK_HELP = 0; + public static final int TOK_EXIT = 1; + public static final int TOK_ADD_BOOK = 2; + public static final int TOK_FIND_ISBN = 3; + public static final int TOK_FIND_AUTHORS = 4; + public static final int TOK_FIND_TITLE = 5; + public static final int TOK_NEXT_FOUND_BOOK = 6; + public static final int TOK_PRINT_CURRENT = 7; + public static final int TOK_RENT_BOOK = 8; + public static final int TOK_RETURN_BOOK = 9; + public static final int TOK_REMOVE_CURRENT = 10; + public static final int TOK_STRING = 11; + public static final int TOK_SEMI = 12; + + int type; + String value; + + Token(int t) + { + type = t; + value = null; + } + + Token(int t, String v) + { + type = t; + value = v; + } +} diff --git a/java/demo/Database/library/books b/java/demo/Database/library/books new file mode 100644 index 00000000000..18836dbdba6 --- /dev/null +++ b/java/demo/Database/library/books @@ -0,0 +1,30 @@ +add '096447963X' 'The Dragon Style (Learn to Play Go, Volume III)' 'Janice Kim, Jeong Soo-Hyun' ; +add '0964479613' "Learn to Play Go: A Master's Guide to the Ultimate Game (Volume I)" 'Janice Kim, Jeong Soo-Hyun' ; +add '0964479621' 'The Way of the Moving Horse (Learn to Play Go, Volume II)' 'Janice Kim, Jeong Soo-Hyun' ; +add '0964479648' 'Battle Strategies (Learn to Play Go Series)' 'Janice Kim, Jeong Soo-Hyun' ; +add '0201889544' 'The C++ Programming Language' 'Bjarne Stroustrup' ; +add '0201543303' 'The Design and Evolution of C++' 'Bjarne Stroustrup' ; +add '0201700735' 'The C++ Programming Language Special Edition' 'Bjarne Stroustrup' ; +add '0201379260' 'The C++ Standard Library : A Tutorial and Reference' 'Nicolai M. Josuttis' ; +add '0201749629' 'Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library' 'Scott Meyers' ; +add '0201924889' 'Effective C++: 50 Specific Ways to Improve Your Programs and Design' 'Scott Meyers' ; +add '020163371X' 'More Effective C++: 35 New Ways to Improve Your Programs and Designs' 'Scott Meyers' ; +add '0201615622' 'Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions' 'Herb Sutter' ; +add '020170434X' 'More Exceptional C++' 'Herb Sutter' ; +add '0201704315' 'Modern C++ Design: Generic Programming and Design Patterns Applied' 'Andrei Alexandrescu' ; +add '0735616353' 'Microsoft Visual C++ .NET Deluxe Learning Edition' 'Microsoft Corporation' ; +add '0735615497' 'Programming with Microsoft Visual C++ .NET, Sixth Edition (Core Reference)' 'George Shepherd, David Kruglinski' ; +add '0735614229' 'Applied Microsoft .NET Framework Programming' 'Jeffrey Richter' ; +add '0201824701' 'C++ Primer' 'Stanley B. Lippman, Josee Lajoie' ; +add '0201485184' 'Essential C++' 'Stanley B. Lippman' ; +add '020170353X' 'Accelerated C++: Practical Programming by Example' 'Andrew Koenig, Barbara E. Moo' ; +add '0201423391' 'Ruminations on C++ : A Decade of Programming Insight and Experience' 'Andrew Koenig, Barbara E. Moo' ; +add '0201179288' 'C Traps and Pitfalls' 'Andrew Koenig' ; +add '0131103628' 'The C Programming Language' 'Brian W. Kernighan, Dennis M. Ritchie' ; +add '020161586X' 'The Practice of Programming' 'Brian W. Kernighan, Rob Pike' ; +add '013937681X' 'UNIX Programming Environment, The' 'Brian W. Kernighan, Rob Pike' ; +add '0201563177' 'Advanced Programming in the UNIX(R) Environment' 'W. Richard Stevens' ; +add '0201633469' 'The Protocols (TCP/IP Illustrated, Volume 1)' 'W. Richard Stevens' ; +add '0201634953' 'TCP for Transactions, HTTP, NNTP, and the UNIX(R) Domain Protocols (TCP/IP Illustrated, Volume 3)' 'W. Richard Stevens' ; +add '013490012X' 'UNIX Network Programming, Volume 1: Networking APIs - Sockets and XTI' 'W. Richard Stevens' ; +add '0130810819' 'UNIX Network Programming: Interprocess Communications' 'W. Richard Stevens' ; diff --git a/java/demo/Database/library/build.xml b/java/demo/Database/library/build.xml new file mode 100644 index 00000000000..915b235a438 --- /dev/null +++ b/java/demo/Database/library/build.xml @@ -0,0 +1,55 @@ +<!-- + ********************************************************************** + + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. + + This copy of Ice is licensed to you under the terms described in the + ICE_LICENSE file included in this distribution. + + ********************************************************************** +--> + +<project name="demo_Database_library" default="all" basedir="."> + + <!-- set global properties for this build --> + <property name="top.dir" value="../../.."/> + + <!-- import common definitions --> + <import file="${top.dir}/config/common.xml"/> + + <target name="generate" depends="init"> + <!-- Create the output directory for generated code --> + <mkdir dir="${generated.dir}"/> + <slice2java outputdir="${generated.dir}" tie="on"> + <meta value="${java2metadata}"/> + <includepath> + <pathelement path="${slice.dir}" /> + </includepath> + <fileset dir="." includes="Library.ice"/> + <fileset dir="." includes="Session.ice"/> + <fileset dir="." includes="Glacier2Session.ice"/> + </slice2java> + </target> + + <target name="compile" depends="generate"> + <mkdir dir="${class.dir}"/> + <javac srcdir="${generated.dir}" destdir="${class.dir}" + debug="${debug}"> + <classpath refid="ice.classpath"/> + <compilerarg value="${javac.lint}"/> + </javac> + <javac srcdir="." destdir="${class.dir}" + excludes="generated/**" debug="${debug}"> + <classpath refid="ice.classpath"/> + <compilerarg value="${javac.lint}"/> + </javac> + </target> + + <target name="all" depends="compile"/> + + <target name="clean"> + <delete dir="${generated.dir}"/> + <delete dir="${class.dir}"/> + </target> + +</project> diff --git a/java/demo/Database/library/config.client b/java/demo/Database/library/config.client new file mode 100644 index 00000000000..978ddf615e7 --- /dev/null +++ b/java/demo/Database/library/config.client @@ -0,0 +1,62 @@ +# +# The client reads this property to create the reference to the +# "SessionFactory" object in the server. +# +SessionFactory.Proxy=SessionFactory:default -p 10000 + +# +# The proxy to the Glacier2 router for all outgoing connections. This +# must match the value of Glacier2.Client.Endpoints in config.glacier2. +# +#Ice.Default.Router=DemoGlacier2/router:ssl -p 4064 -h 127.0.0.1 + +# +# No active connection management is permitted because of the session +# interfaces. Connections must remain established. +# +Ice.ACM.Client=0 + +# +# Connection retry is not possible because of the session +# interfaces. Connections must remain established. +# +Ice.RetryIntervals=-1 + +# +# Warn about connection exceptions +# +#Ice.Warn.Connections=1 + +# +# Network Tracing +# +# 0 = no network tracing +# 1 = trace connection establishment and closure +# 2 = like 1, but more detailed +# 3 = like 2, but also trace data transfer +# +#Ice.Trace.Network=1 + +# +# Protocol Tracing +# +# 0 = no protocol tracing +# 1 = trace protocol messages +# +#Ice.Trace.Protocol=1 + +# +# Security Tracing +# +# 0 = no security tracing +# 1 = trace messages +# +#IceSSL.Trace.Security=1 + +# +# SSL Configuration +# +Ice.Plugin.IceSSL=IceSSL.PluginFactory +IceSSL.DefaultDir=../../../../certs +IceSSL.Truststore=certs.jks +IceSSL.TrustOnly.Client=CN=Server diff --git a/java/demo/Database/library/config.glacier2 b/java/demo/Database/library/config.glacier2 new file mode 100644 index 00000000000..053dbff990b --- /dev/null +++ b/java/demo/Database/library/config.glacier2 @@ -0,0 +1,55 @@ +# +# Set the Glacier2 instance name. +# +Glacier2.InstanceName=DemoGlacier2 + +# +# The client-visible endpoint of Glacier2. This should be an endpoint +# visible from the public Internet, and it should be secure. +# +Glacier2.Client.Endpoints=ssl -p 4064 -h 127.0.0.1 + +# +# The server-visible endpoint of Glacier2. This endpoint is only +# required if callbacks are needed (leave empty otherwise). This +# should be an endpoint on an internal network (like 192.168.x.x), or +# on the loopback, so that the server is not directly accessible from +# the Internet. +# +Glacier2.Server.Endpoints=tcp -h 127.0.0.1 + +# +# The proxy of the session manager. +# +Glacier2.SessionManager=LibrarySessionManager:tcp -h 127.0.0.1 -p 10000 + +# +# For this demo, we use the null permissions verifier. This permissions +# verifier allows any user-id / password combination. +# +Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier + +# +# The timeout for inactive sessions. If any client session is inactive +# for longer than this value, the session expires and is removed. The +# unit is seconds. +# +Glacier2.SessionTimeout=30 + +# +# Security Tracing +# +# 0 = no security tracing +# 1 = trace messages +# +IceSSL.Trace.Security=1 + +# +# SSL Configuration +# +Ice.Plugin.IceSSL=IceSSL:createIceSSL +IceSSL.DefaultDir=../../../../certs +IceSSL.CertAuthFile=cacert.pem +IceSSL.CertFile=s_rsa1024_pub.pem +IceSSL.KeyFile=s_rsa1024_priv.pem +IceSSL.VerifyPeer=0 diff --git a/java/demo/Database/library/config.server b/java/demo/Database/library/config.server new file mode 100644 index 00000000000..ef3eef86199 --- /dev/null +++ b/java/demo/Database/library/config.server @@ -0,0 +1,64 @@ +# +# Configure the server endpoints. +# +SessionFactory.Endpoints=tcp -p 10000:ssl -p 10001 + +# JDBC configuration. +JDBC.Username=USER +JDBC.Password=PASSWORD +JDBC.Url=jdbc:mysql://localhost/library + +# The number of connections in the JDBC connection pool. This number +# should be at least as big as the number of the threads in the server +# thread pool. +JDBC.NumConnections=5 + +# Number of threads in the server-side dispatch thread pool. +Ice.ThreadPool.Server.Size=5 + +# +# How long to keep sessions alive with no activity. Its best to use +# the same value as config.glacier2. +# +SessionTimeout=30 + +# +# Warn about connection exceptions +# +Ice.Warn.Connections=1 + +# +# Network Tracing +# +# 0 = no network tracing +# 1 = trace connection establishment and closure +# 2 = like 1, but more detailed +# 3 = like 2, but also trace data transfer +# +#Ice.Trace.Network=1 + +# +# Protocol Tracing +# +# 0 = no protocol tracing +# 1 = trace protocol messages +# +#Ice.Trace.Protocol=1 + +# +# Security Tracing +# +# 0 = no security tracing +# 1 = trace messages +# +#IceSSL.Trace.Security=1 + +# +# SSL Configuration +# +Ice.Plugin.IceSSL=IceSSL.PluginFactory +IceSSL.VerifyPeer=0 +IceSSL.DefaultDir=../../../../certs +IceSSL.Keystore=server.jks +IceSSL.Password=password +IceSSL.Truststore=certs.jks diff --git a/java/demo/Database/library/createTypes.sql b/java/demo/Database/library/createTypes.sql new file mode 100644 index 00000000000..d6d1b5a5d2c --- /dev/null +++ b/java/demo/Database/library/createTypes.sql @@ -0,0 +1,43 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** +# +# Initialize SQL tables. +# +DROP TABLE IF EXISTS books; +CREATE TABLE books +( + id INT UNSIGNED AUTO_INCREMENT NOT NULL, + PRIMARY KEY (id), + isbn CHAR(10), + title VARCHAR(255), + renter_id INT +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS authors_books; +CREATE TABLE authors_books +( + book_id INT, + author_id INT +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS authors; +CREATE TABLE authors +( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + PRIMARY KEY(id), + name VARCHAR(255) +) ENGINE=InnoDB; + +DROP TABLE IF EXISTS customers; +CREATE TABLE customers +( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + PRIMARY KEY(id), + name VARCHAR(255) +) ENGINE=InnoDB; diff --git a/java/demo/Freeze/bench/Client.java b/java/demo/Freeze/bench/Client.java index 6492a3da01d..946dae1c76d 100644 --- a/java/demo/Freeze/bench/Client.java +++ b/java/demo/Freeze/bench/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -9,13 +9,8 @@ import Demo.*; -class TestApp extends Ice.Application +class Client extends Ice.Application { - TestApp(String envName) - { - _envName = envName; - } - void IntIntMapTest(Freeze.Map m, boolean fast) { @@ -594,18 +589,20 @@ class TestApp extends Ice.Application } } - private Freeze.Connection _connection; - private int _repetitions = 10000; - private StopWatch _watch = new StopWatch(); - private String _envName; -} + Client(String envName) + { + _envName = envName; + } -public class Client -{ static public void main(String[] args) { - TestApp app = new TestApp("db"); - app.main("test.Freeze.bench.Client", args); + Client app = new Client("db"); + app.main("demo.Freeze.bench.Client", args); } + + private Freeze.Connection _connection; + private int _repetitions = 10000; + private StopWatch _watch = new StopWatch(); + private String _envName; } diff --git a/java/demo/Freeze/bench/StopWatch.java b/java/demo/Freeze/bench/StopWatch.java index fbffe6ab85a..f4de9f0d643 100644 --- a/java/demo/Freeze/bench/StopWatch.java +++ b/java/demo/Freeze/bench/StopWatch.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/bench/Test.ice b/java/demo/Freeze/bench/Test.ice index a4bec5eed77..fd6988197fd 100644 --- a/java/demo/Freeze/bench/Test.ice +++ b/java/demo/Freeze/bench/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/bench/build.xml b/java/demo/Freeze/bench/build.xml index 0c27f052934..420ed9850c5 100644 --- a/java/demo/Freeze/bench/build.xml +++ b/java/demo/Freeze/bench/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/bench/expect.py b/java/demo/Freeze/bench/expect.py index 8cb0124e45f..e260be464a0 100755 --- a/java/demo/Freeze/bench/expect.py +++ b/java/demo/Freeze/bench/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/build.xml b/java/demo/Freeze/build.xml index 179419d37d3..177f3834eda 100644 --- a/java/demo/Freeze/build.xml +++ b/java/demo/Freeze/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/BankI.java b/java/demo/Freeze/casino/BankI.java index 4de5a3455bf..4c062f6cfdd 100644 --- a/java/demo/Freeze/casino/BankI.java +++ b/java/demo/Freeze/casino/BankI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/BetI.java b/java/demo/Freeze/casino/BetI.java index 48358679e66..d4deb31a058 100644 --- a/java/demo/Freeze/casino/BetI.java +++ b/java/demo/Freeze/casino/BetI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/BetResolver.java b/java/demo/Freeze/casino/BetResolver.java index a4469f17eca..f10bb3cfd47 100644 --- a/java/demo/Freeze/casino/BetResolver.java +++ b/java/demo/Freeze/casino/BetResolver.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/Casino.ice b/java/demo/Freeze/casino/Casino.ice index 4ed9c9b6eca..35982a8d057 100644 --- a/java/demo/Freeze/casino/Casino.ice +++ b/java/demo/Freeze/casino/Casino.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/CasinoStore.ice b/java/demo/Freeze/casino/CasinoStore.ice index 990a5a026e5..f240f1a9a2e 100644 --- a/java/demo/Freeze/casino/CasinoStore.ice +++ b/java/demo/Freeze/casino/CasinoStore.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/Client.java b/java/demo/Freeze/casino/Client.java index 6e33d89b52f..d5e5965c31f 100644 --- a/java/demo/Freeze/casino/Client.java +++ b/java/demo/Freeze/casino/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/PlayerI.java b/java/demo/Freeze/casino/PlayerI.java index 097daa453f6..2bc792b2e65 100644 --- a/java/demo/Freeze/casino/PlayerI.java +++ b/java/demo/Freeze/casino/PlayerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/Server.java b/java/demo/Freeze/casino/Server.java index 298b540d4b3..cf1cbde5922 100644 --- a/java/demo/Freeze/casino/Server.java +++ b/java/demo/Freeze/casino/Server.java @@ -1,13 +1,13 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -class CasinoServer extends Ice.Application +class Server extends Ice.Application { static class ObjectFactory implements Ice.ObjectFactory { @@ -223,11 +223,18 @@ class CasinoServer extends Ice.Application return 0; } - CasinoServer(String envName) + Server(String envName) { _envName = envName; } + static public void + main(String[] args) + { + Server app = new Server("db"); + app.main("demo.Freeze.casino.Server", args, "config.server"); + } + private String _envName; private CasinoStore.PersistentBankPrx _bankPrx; @@ -237,13 +244,3 @@ class CasinoServer extends Ice.Application private BetResolver _betResolver; private int _bankEdge; } - -public class Server -{ - static public void - main(String[] args) - { - CasinoServer app = new CasinoServer("db"); - app.main("demo.Freeze.casino.Server", args, "config.server"); - } -} diff --git a/java/demo/Freeze/casino/build.xml b/java/demo/Freeze/casino/build.xml index 9a9b6cf5b4c..cec4df18549 100644 --- a/java/demo/Freeze/casino/build.xml +++ b/java/demo/Freeze/casino/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/casino/expect.py b/java/demo/Freeze/casino/expect.py index e77867c61ba..93817ecc9fe 100755 --- a/java/demo/Freeze/casino/expect.py +++ b/java/demo/Freeze/casino/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/BookFactory.java b/java/demo/Freeze/library/BookFactory.java index 7a4faf0b02f..8d6171ed1fd 100644 --- a/java/demo/Freeze/library/BookFactory.java +++ b/java/demo/Freeze/library/BookFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/BookI.java b/java/demo/Freeze/library/BookI.java index b1c1c350e07..906147bf8d6 100644 --- a/java/demo/Freeze/library/BookI.java +++ b/java/demo/Freeze/library/BookI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Client.java b/java/demo/Freeze/library/Client.java index 8a181ef1519..e857f90975f 100644 --- a/java/demo/Freeze/library/Client.java +++ b/java/demo/Freeze/library/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Collocated.java b/java/demo/Freeze/library/Collocated.java index 8d5c033c2d7..7e275e1d229 100644 --- a/java/demo/Freeze/library/Collocated.java +++ b/java/demo/Freeze/library/Collocated.java @@ -1,13 +1,13 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -class LibraryCollocated extends Ice.Application +class Collocated extends Ice.Application { class ShutdownHook extends Thread { @@ -76,20 +76,17 @@ class LibraryCollocated extends Ice.Application return status; } - LibraryCollocated(String envName) + Collocated(String envName) { _envName = envName; } - private String _envName; -} - -public class Collocated -{ static public void main(String[] args) { - LibraryCollocated app = new LibraryCollocated("db"); + Collocated app = new Collocated("db"); app.main("demo.Freeze.library.Collocated", args, "config.collocated"); } + + private String _envName; } diff --git a/java/demo/Freeze/library/Grammar.java b/java/demo/Freeze/library/Grammar.java index 9032257c507..c261cc0921e 100644 --- a/java/demo/Freeze/library/Grammar.java +++ b/java/demo/Freeze/library/Grammar.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Library.ice b/java/demo/Freeze/library/Library.ice index 23d2c05105b..f01235e7561 100644 --- a/java/demo/Freeze/library/Library.ice +++ b/java/demo/Freeze/library/Library.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/LibraryI.java b/java/demo/Freeze/library/LibraryI.java index 99b95153720..94b9be5d916 100644 --- a/java/demo/Freeze/library/LibraryI.java +++ b/java/demo/Freeze/library/LibraryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Parser.java b/java/demo/Freeze/library/Parser.java index bcaab37fdcb..8d2c5256f70 100644 --- a/java/demo/Freeze/library/Parser.java +++ b/java/demo/Freeze/library/Parser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/RunParser.java b/java/demo/Freeze/library/RunParser.java index 45467642219..44f37b46ff2 100644 --- a/java/demo/Freeze/library/RunParser.java +++ b/java/demo/Freeze/library/RunParser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Scanner.java b/java/demo/Freeze/library/Scanner.java index 0cab1b1e942..975eaece2dd 100644 --- a/java/demo/Freeze/library/Scanner.java +++ b/java/demo/Freeze/library/Scanner.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/Server.java b/java/demo/Freeze/library/Server.java index 08295ab1b44..2edfb823034 100644 --- a/java/demo/Freeze/library/Server.java +++ b/java/demo/Freeze/library/Server.java @@ -1,13 +1,13 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -class LibraryServer extends Ice.Application +class Server extends Ice.Application { public int run(String[] args) @@ -62,20 +62,17 @@ class LibraryServer extends Ice.Application return 0; } - LibraryServer(String envName) + Server(String envName) { _envName = envName; } - private String _envName; -} - -public class Server -{ static public void main(String[] args) { - LibraryServer app = new LibraryServer("db"); + Server app = new Server("db"); app.main("demo.Freeze.library.Server", args, "config.server"); } + + private String _envName; } diff --git a/java/demo/Freeze/library/Token.java b/java/demo/Freeze/library/Token.java index 2664e64e655..f0a90f5b1c9 100644 --- a/java/demo/Freeze/library/Token.java +++ b/java/demo/Freeze/library/Token.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/build.xml b/java/demo/Freeze/library/build.xml index 34f2b41d529..ae9ae29f883 100644 --- a/java/demo/Freeze/library/build.xml +++ b/java/demo/Freeze/library/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/library/expect.py b/java/demo/Freeze/library/expect.py index ad23895a0d3..60d0fbac1f9 100755 --- a/java/demo/Freeze/library/expect.py +++ b/java/demo/Freeze/library/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Client.java b/java/demo/Freeze/phonebook/Client.java index 01dc1f55543..85b0d14d611 100644 --- a/java/demo/Freeze/phonebook/Client.java +++ b/java/demo/Freeze/phonebook/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Collocated.java b/java/demo/Freeze/phonebook/Collocated.java index dbd82106400..47abe391520 100644 --- a/java/demo/Freeze/phonebook/Collocated.java +++ b/java/demo/Freeze/phonebook/Collocated.java @@ -1,13 +1,13 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -class PhoneBookCollocated extends Ice.Application +class Collocated extends Ice.Application { class ShutdownHook extends Thread { @@ -97,20 +97,17 @@ class PhoneBookCollocated extends Ice.Application return status; } - PhoneBookCollocated(String envName) + Collocated(String envName) { _envName = envName; } - private String _envName; -} - -public class Collocated -{ static public void main(String[] args) { - PhoneBookCollocated app = new PhoneBookCollocated("db"); + Collocated app = new Collocated("db"); app.main("demo.Freeze.phonebook.Collocated", args, "config.collocated"); } + + private String _envName; } diff --git a/java/demo/Freeze/phonebook/ContactFactory.java b/java/demo/Freeze/phonebook/ContactFactory.java index 24ecedb0920..6f5a97e5fbd 100644 --- a/java/demo/Freeze/phonebook/ContactFactory.java +++ b/java/demo/Freeze/phonebook/ContactFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/ContactI.java b/java/demo/Freeze/phonebook/ContactI.java index 7bdbc85040d..283bd2cc5c2 100644 --- a/java/demo/Freeze/phonebook/ContactI.java +++ b/java/demo/Freeze/phonebook/ContactI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Grammar.java b/java/demo/Freeze/phonebook/Grammar.java index ce3ec139295..803966e4977 100644 --- a/java/demo/Freeze/phonebook/Grammar.java +++ b/java/demo/Freeze/phonebook/Grammar.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Parser.java b/java/demo/Freeze/phonebook/Parser.java index c4ea6bf7aef..0fa49111b29 100644 --- a/java/demo/Freeze/phonebook/Parser.java +++ b/java/demo/Freeze/phonebook/Parser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/PhoneBook.ice b/java/demo/Freeze/phonebook/PhoneBook.ice index 8143fcd6ab4..72bab6fd30d 100644 --- a/java/demo/Freeze/phonebook/PhoneBook.ice +++ b/java/demo/Freeze/phonebook/PhoneBook.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/PhoneBookI.java b/java/demo/Freeze/phonebook/PhoneBookI.java index 8b762024d84..9a557994dfc 100644 --- a/java/demo/Freeze/phonebook/PhoneBookI.java +++ b/java/demo/Freeze/phonebook/PhoneBookI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/RunParser.java b/java/demo/Freeze/phonebook/RunParser.java index cf86c3a42fd..6ff9febc3a4 100644 --- a/java/demo/Freeze/phonebook/RunParser.java +++ b/java/demo/Freeze/phonebook/RunParser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Scanner.java b/java/demo/Freeze/phonebook/Scanner.java index d2b19b29c4f..db438f8fe5f 100644 --- a/java/demo/Freeze/phonebook/Scanner.java +++ b/java/demo/Freeze/phonebook/Scanner.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/Server.java b/java/demo/Freeze/phonebook/Server.java index ba013f999dc..3dbf0d0d0d1 100644 --- a/java/demo/Freeze/phonebook/Server.java +++ b/java/demo/Freeze/phonebook/Server.java @@ -1,13 +1,13 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -class PhoneBookServer extends Ice.Application +class Server extends Ice.Application { public int run(String[] args) @@ -82,20 +82,17 @@ class PhoneBookServer extends Ice.Application return 0; } - PhoneBookServer(String envName) + Server(String envName) { _envName = envName; } - private String _envName; -} - -public class Server -{ static public void main(String[] args) { - PhoneBookServer app = new PhoneBookServer("db"); + Server app = new Server("db"); app.main("demo.Freeze.phonebook.Server", args, "config.server"); } + + private String _envName; } diff --git a/java/demo/Freeze/phonebook/Token.java b/java/demo/Freeze/phonebook/Token.java index 9de2eef452c..eb2ce1bd7c6 100644 --- a/java/demo/Freeze/phonebook/Token.java +++ b/java/demo/Freeze/phonebook/Token.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/build.xml b/java/demo/Freeze/phonebook/build.xml index a90696ddc5c..233435b6cde 100644 --- a/java/demo/Freeze/phonebook/build.xml +++ b/java/demo/Freeze/phonebook/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/phonebook/expect.py b/java/demo/Freeze/phonebook/expect.py index 1b4300921b8..94519f0f460 100755 --- a/java/demo/Freeze/phonebook/expect.py +++ b/java/demo/Freeze/phonebook/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/transform/ContactData.ice b/java/demo/Freeze/transform/ContactData.ice index 156e4ce8ceb..0dc5bfb53a3 100644 --- a/java/demo/Freeze/transform/ContactData.ice +++ b/java/demo/Freeze/transform/ContactData.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/transform/Create.java b/java/demo/Freeze/transform/Create.java index 892244cb7d9..9086bf7c3e5 100644 --- a/java/demo/Freeze/transform/Create.java +++ b/java/demo/Freeze/transform/Create.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -81,6 +81,6 @@ class Create extends Ice.Application main(String[] args) { Create app = new Create(); - app.main("test.Freeze.transform.Create", args); + app.main("demo.Freeze.transform.Create", args); } } diff --git a/java/demo/Freeze/transform/NewContactData.ice b/java/demo/Freeze/transform/NewContactData.ice index 473428fba13..97bb3c6e660 100644 --- a/java/demo/Freeze/transform/NewContactData.ice +++ b/java/demo/Freeze/transform/NewContactData.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/transform/Read.java b/java/demo/Freeze/transform/Read.java index 476ddd2b24c..028a067cbe1 100644 --- a/java/demo/Freeze/transform/Read.java +++ b/java/demo/Freeze/transform/Read.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -86,6 +86,6 @@ class Read extends Ice.Application main(String[] args) { Read app = new Read(); - app.main("test.Freeze.transform.Read", args); + app.main("demo.Freeze.transform.Read", args); } } diff --git a/java/demo/Freeze/transform/ReadNew.java b/java/demo/Freeze/transform/ReadNew.java index 8759dd24dbe..cc87e25c91a 100644 --- a/java/demo/Freeze/transform/ReadNew.java +++ b/java/demo/Freeze/transform/ReadNew.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -92,6 +92,6 @@ class ReadNew extends Ice.Application main(String[] args) { ReadNew app = new ReadNew(); - app.main("test.Freeze.transform.ReadNew", args); + app.main("demo.Freeze.transform.ReadNew", args); } } diff --git a/java/demo/Freeze/transform/Recreate.java b/java/demo/Freeze/transform/Recreate.java index 89bbe8ded56..709ccb05f03 100644 --- a/java/demo/Freeze/transform/Recreate.java +++ b/java/demo/Freeze/transform/Recreate.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -64,6 +64,6 @@ class Recreate extends Ice.Application main(String[] args) { Recreate app = new Recreate(); - app.main("test.Freeze.transform.Recreate", args); + app.main("demo.Freeze.transform.Recreate", args); } } diff --git a/java/demo/Freeze/transform/build.xml b/java/demo/Freeze/transform/build.xml index ec4a9881dfb..cf84d604e26 100644 --- a/java/demo/Freeze/transform/build.xml +++ b/java/demo/Freeze/transform/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Freeze/transform/expect.py b/java/demo/Freeze/transform/expect.py index efc1c87eded..1a735cca7a7 100755 --- a/java/demo/Freeze/transform/expect.py +++ b/java/demo/Freeze/transform/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/build.xml b/java/demo/Glacier2/build.xml index cb5c1197701..cfb2c825c15 100644 --- a/java/demo/Glacier2/build.xml +++ b/java/demo/Glacier2/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/Callback.ice b/java/demo/Glacier2/callback/Callback.ice index cf88e72cb89..f6eb62c7fc9 100644 --- a/java/demo/Glacier2/callback/Callback.ice +++ b/java/demo/Glacier2/callback/Callback.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/CallbackI.java b/java/demo/Glacier2/callback/CallbackI.java index 4378869ec84..2013f349ded 100644 --- a/java/demo/Glacier2/callback/CallbackI.java +++ b/java/demo/Glacier2/callback/CallbackI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/CallbackReceiverI.java b/java/demo/Glacier2/callback/CallbackReceiverI.java index 8e6ff9bd523..92374aeb750 100644 --- a/java/demo/Glacier2/callback/CallbackReceiverI.java +++ b/java/demo/Glacier2/callback/CallbackReceiverI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/Client.java b/java/demo/Glacier2/callback/Client.java index 28473d952d2..8f3eba5a129 100644 --- a/java/demo/Glacier2/callback/Client.java +++ b/java/demo/Glacier2/callback/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/Server.java b/java/demo/Glacier2/callback/Server.java index bfaf4b019fc..8ba2f8e3336 100644 --- a/java/demo/Glacier2/callback/Server.java +++ b/java/demo/Glacier2/callback/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/SessionI.java b/java/demo/Glacier2/callback/SessionI.java index 66c2bba8c06..dcde51ee743 100644 --- a/java/demo/Glacier2/callback/SessionI.java +++ b/java/demo/Glacier2/callback/SessionI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/SessionManagerI.java b/java/demo/Glacier2/callback/SessionManagerI.java index aee1627213e..fedb807dd8a 100644 --- a/java/demo/Glacier2/callback/SessionManagerI.java +++ b/java/demo/Glacier2/callback/SessionManagerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/SessionServer.java b/java/demo/Glacier2/callback/SessionServer.java index 98524bf55c3..e1af132c9d9 100644 --- a/java/demo/Glacier2/callback/SessionServer.java +++ b/java/demo/Glacier2/callback/SessionServer.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/build.xml b/java/demo/Glacier2/callback/build.xml index bd57a2ee23a..35ca424f1f0 100644 --- a/java/demo/Glacier2/callback/build.xml +++ b/java/demo/Glacier2/callback/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Glacier2/callback/expect.py b/java/demo/Glacier2/callback/expect.py index 4a9675316dc..224a9a8e193 100755 --- a/java/demo/Glacier2/callback/expect.py +++ b/java/demo/Glacier2/callback/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/README b/java/demo/Ice/README index ed7506e7146..6a9eceee376 100644 --- a/java/demo/Ice/README +++ b/java/demo/Ice/README @@ -1,9 +1,14 @@ Demos in this directory: +- applet + + An unsigned applet that demonstrates how to use Asynchronous Method + Invocation (AMI) in a graphical client. + - async - This demo illustrates the use of Asynchronous Message Invocation - (AMI) and Asynchronous Message Dispatch (AMD). + This demo illustrates the use of Asynchronous Method Invocation + (AMI) and Asynchronous Method Dispatch (AMD). - bidir diff --git a/java/demo/Ice/applet/.gitignore b/java/demo/Ice/applet/.gitignore new file mode 100644 index 00000000000..e5786e5ddd4 --- /dev/null +++ b/java/demo/Ice/applet/.gitignore @@ -0,0 +1 @@ +Hello.jar diff --git a/java/demo/Ice/applet/Hello.ice b/java/demo/Ice/applet/Hello.ice new file mode 100644 index 00000000000..b5c9e4a599e --- /dev/null +++ b/java/demo/Ice/applet/Hello.ice @@ -0,0 +1,24 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef HELLO_ICE +#define HELLO_ICE + +module Demo +{ + +interface Hello +{ + ["ami"] idempotent void sayHello(int delay); + ["ami"] void shutdown(); +}; + +}; + +#endif diff --git a/java/demo/Ice/applet/HelloApplet.java b/java/demo/Ice/applet/HelloApplet.java new file mode 100644 index 00000000000..504f775a148 --- /dev/null +++ b/java/demo/Ice/applet/HelloApplet.java @@ -0,0 +1,617 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.event.*; + +public class HelloApplet extends JApplet +{ + public void init() + { + // + // Make sure we create the GUI from the Swing event dispatch thread. + // + try + { + SwingUtilities.invokeAndWait(new Runnable() + { + public void run() + { + initUI(); + } + }); + } + catch(Throwable ex) + { + ex.printStackTrace(); + return; + } + + // + // Initialize an Ice communicator. + // + try + { + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(); + initData.properties.setProperty("Ice.ACM.Client", "10"); + initData.properties.setProperty("Ice.Trace.Network", "3"); + initData.properties.setProperty("IceSSL.Trace.Security", "3"); + initData.properties.setProperty("IceSSL.Password", "password"); + initData.properties.setProperty("Ice.InitPlugins", "0"); + initData.properties.setProperty("Ice.Plugin.IceSSL", "IceSSL.PluginFactory"); + _communicator = Ice.Util.initialize(initData); + + // + // We delayed the initialization of the IceSSL plug-in by setting Ice.InitPlugins=0. + // Now we obtain a reference to the plugin so that we can supply a keystore and + // truststore using a resource file. + // + IceSSL.Plugin plugin = (IceSSL.Plugin)_communicator.getPluginManager().getPlugin("IceSSL"); + java.io.InputStream certs = getClass().getClassLoader().getResourceAsStream("client.jks"); + plugin.setKeystoreStream(certs); + plugin.setTruststoreStream(certs); + + // + // Finally, we're ready to complete the initialization. + // + _communicator.getPluginManager().initializePlugins(); + } + catch(Throwable ex) + { + handleException(ex); + } + } + + public void start() + { + // Nothing to do. + } + + public void stop() + { + // Nothing to do. + } + + public void destroy() + { + // + // Destroy the Ice run time. + // + if(_communicator != null) + { + try + { + _communicator.destroy(); + } + catch(Throwable ex) + { + ex.printStackTrace(); + } + _communicator = null; + } + } + + private void initUI() + { + Container cp = getContentPane(); + + JLabel l1 = new JLabel("Hostname"); + _hostname = new JTextField(); + JLabel l2 = new JLabel("Mode"); + _mode = new JComboBox(); + JLabel l3 = new JLabel("Timeout"); + _timeoutSlider = new JSlider(0, MAX_TIME); + _timeoutLabel = new JLabel("0.0"); + JLabel l4 = new JLabel("Delay"); + _delaySlider = new JSlider(0, MAX_TIME); + _delayLabel = new JLabel("0.0"); + JPanel buttonPanel = new JPanel(); + _hello = new JButton("Hello World!"); + _shutdown = new JButton("Shutdown"); + _flush = new JButton("Flush"); + _flush.setEnabled(false); + JPanel statusPanel = new JPanel(); + JSeparator statusPanelSeparator = new JSeparator(); + _status = new JLabel(); + _status.setText("Ready"); + + // + // Default to the host from which the applet was downloaded. + // + _hostname.setText(getCodeBase().getHost()); + + final String[] modes = new String[] + { + "Twoway", "Twoway Secure", "Oneway", "Oneway Batch", "Oneway Secure", "Oneway Secure Batch", "Datagram", + "Datagram Batch" + }; + _mode.setModel(new DefaultComboBoxModel(modes)); + + _hello.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + sayHello(); + } + }); + _shutdown.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + shutdown(); + } + }); + _flush.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + flush(); + } + }); + _mode.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + changeDeliveryMode(_mode.getSelectedIndex()); + } + }); + changeDeliveryMode(_mode.getSelectedIndex()); + + _timeoutSlider.addChangeListener(new SliderListener(_timeoutSlider, _timeoutLabel)); + _timeoutSlider.setValue(0); + _delaySlider.addChangeListener(new SliderListener(_delaySlider, _delayLabel)); + _delaySlider.setValue(0); + + GridBagConstraints gridBagConstraints; + + cp.setMaximumSize(null); + cp.setPreferredSize(null); + cp.setLayout(new GridBagLayout()); + + l1.setText("Hostname"); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(5, 5, 5, 5); + cp.add(l1, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new Insets(5, 0, 5, 5); + cp.add(_hostname, gridBagConstraints); + + l2.setText("Mode"); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(0, 5, 5, 0); + cp.add(l2, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new Insets(0, 0, 5, 5); + cp.add(_mode, gridBagConstraints); + + l3.setText("Timeout"); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(0, 5, 5, 0); + cp.add(l3, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = GridBagConstraints.WEST; + cp.add(_timeoutSlider, gridBagConstraints); + + _timeoutLabel.setMinimumSize(new Dimension(20, 17)); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(0, 5, 5, 5); + cp.add(_timeoutLabel, gridBagConstraints); + + l4.setText("Delay"); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(0, 5, 5, 0); + cp.add(l4, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 3; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = GridBagConstraints.WEST; + cp.add(_delaySlider, gridBagConstraints); + + _delayLabel.setMinimumSize(new Dimension(20, 17)); + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 3; + gridBagConstraints.anchor = GridBagConstraints.WEST; + gridBagConstraints.insets = new Insets(0, 5, 5, 5); + cp.add(_delayLabel, gridBagConstraints); + + _hello.setText("Hello World!"); + buttonPanel.add(_hello); + + _shutdown.setText("Shutdown"); + buttonPanel.add(_shutdown); + + _flush.setText("Flush"); + buttonPanel.add(_flush); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.ipady = 5; + cp.add(buttonPanel, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 5; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new Insets(0, 5, 5, 5); + cp.add(statusPanelSeparator, gridBagConstraints); + + gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 6; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.insets = new Insets(0, 5, 5, 5); + cp.add(_status, gridBagConstraints); + } + + private enum DeliveryMode + { + TWOWAY, + TWOWAY_SECURE, + ONEWAY, + ONEWAY_BATCH, + ONEWAY_SECURE, + ONEWAY_SECURE_BATCH, + DATAGRAM, + DATAGRAM_BATCH; + + Ice.ObjectPrx apply(Ice.ObjectPrx prx) + { + switch (this) + { + case TWOWAY: + prx = prx.ice_twoway(); + break; + case TWOWAY_SECURE: + prx = prx.ice_twoway().ice_secure(true); + break; + case ONEWAY: + prx = prx.ice_oneway(); + break; + case ONEWAY_BATCH: + prx = prx.ice_batchOneway(); + break; + case ONEWAY_SECURE: + prx = prx.ice_oneway().ice_secure(true); + break; + case ONEWAY_SECURE_BATCH: + prx = prx.ice_batchOneway().ice_secure(true); + break; + case DATAGRAM: + prx = prx.ice_datagram(); + break; + case DATAGRAM_BATCH: + prx = prx.ice_batchDatagram(); + break; + } + return prx; + } + + public boolean isBatch() + { + return this == ONEWAY_BATCH || this == DATAGRAM_BATCH || this == ONEWAY_SECURE_BATCH; + } + } + + private Demo.HelloPrx createProxy() + { + String host = _hostname.getText().toString().trim(); + if(host.length() == 0) + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + _status.setText("No hostname"); + } + }); + return null; + } + + String s = "hello:tcp -h " + host + " -p 10000:ssl -h " + host + " -p 10001:udp -h " + host + " -p 10000"; + Ice.ObjectPrx prx = _communicator.stringToProxy(s); + prx = _deliveryMode.apply(prx); + int timeout = _timeoutSlider.getValue(); + if(timeout != 0) + { + prx = prx.ice_timeout(timeout); + } + return Demo.HelloPrxHelper.uncheckedCast(prx); + } + + class SayHelloI extends Demo.AMI_Hello_sayHello implements Ice.AMISentCallback + { + private boolean _response = false; + + synchronized public void ice_exception(final Ice.LocalException ex) + { + assert (!_response); + _response = true; + + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + handleException(ex); + } + }); + } + + synchronized public void ice_sent() + { + if(_response) + { + return; + } + + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + if(_deliveryMode == DeliveryMode.TWOWAY || _deliveryMode == DeliveryMode.TWOWAY_SECURE) + { + _status.setText("Waiting for response"); + } + else + { + _status.setText("Ready"); + } + } + }); + } + + synchronized public void ice_response() + { + assert (!_response); + _response = true; + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + _status.setText("Ready"); + } + }); + } + } + + private void sayHello() + { + Demo.HelloPrx hello = createProxy(); + if(hello == null) + { + return; + } + + int delay = _delaySlider.getValue(); + try + { + if(!_deliveryMode.isBatch()) + { + if(hello.sayHello_async(new SayHelloI(), delay)) + { + if(_deliveryMode == DeliveryMode.TWOWAY || _deliveryMode == DeliveryMode.TWOWAY_SECURE) + { + _status.setText("Waiting for response"); + } + } + else + { + _status.setText("Sending request"); + } + } + else + { + _flush.setEnabled(true); + hello.sayHello(delay); + _status.setText("Queued sayHello request"); + } + } + catch(Ice.LocalException ex) + { + handleException(ex); + } + } + + private void shutdown() + { + Demo.HelloPrx hello = createProxy(); + if(hello == null) + { + return; + } + + try + { + if(!_deliveryMode.isBatch()) + { + hello.shutdown_async(new Demo.AMI_Hello_shutdown() + { + public void ice_exception(final Ice.LocalException ex) + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + handleException(ex); + } + }); + } + + public void ice_response() + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + _status.setText("Ready"); + } + }); + } + }); + if(_deliveryMode == DeliveryMode.TWOWAY || _deliveryMode == DeliveryMode.TWOWAY_SECURE) + { + _status.setText("Waiting for response"); + } + } + else + { + _flush.setEnabled(true); + hello.shutdown(); + _status.setText("Queued shutdown request"); + } + } + catch(Ice.LocalException ex) + { + handleException(ex); + } + } + + private void flush() + { + new Thread(new Runnable() + { + public void run() + { + try + { + _communicator.flushBatchRequests(); + } + catch(final Ice.LocalException ex) + { + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + handleException(ex); + } + }); + } + } + }).start(); + + _flush.setEnabled(false); + _status.setText("Flushed batch requests"); + } + + private void changeDeliveryMode(long id) + { + switch ((int)id) + { + case 0: + _deliveryMode = DeliveryMode.TWOWAY; + break; + case 1: + _deliveryMode = DeliveryMode.TWOWAY_SECURE; + break; + case 2: + _deliveryMode = DeliveryMode.ONEWAY; + break; + case 3: + _deliveryMode = DeliveryMode.ONEWAY_BATCH; + break; + case 4: + _deliveryMode = DeliveryMode.ONEWAY_SECURE; + break; + case 5: + _deliveryMode = DeliveryMode.ONEWAY_SECURE_BATCH; + break; + case 6: + _deliveryMode = DeliveryMode.DATAGRAM; + break; + case 7: + _deliveryMode = DeliveryMode.DATAGRAM_BATCH; + break; + } + } + + private void handleException(final Throwable ex) + { + ex.printStackTrace(); + SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + _status.setText(ex.getClass().getName()); + } + } + ); + } + + private static class SliderListener implements ChangeListener + { + SliderListener(JSlider slider, JLabel label) + { + _slider = slider; + _label = label; + } + + public void stateChanged(ChangeEvent ce) + { + float value = (float)(_slider.getValue() / 1000.0); + _label.setText(String.format("%.1f", value)); + } + + private JSlider _slider; + private JLabel _label; + } + + private static final int MAX_TIME = 5000; // 5 seconds + + private JTextField _hostname; + private JComboBox _mode; + private JSlider _timeoutSlider; + private JLabel _timeoutLabel; + private JSlider _delaySlider; + private JLabel _delayLabel; + private JButton _hello; + private JButton _shutdown; + private JButton _flush; + private JLabel _status; + + private Ice.Communicator _communicator; + private DeliveryMode _deliveryMode; +} diff --git a/java/demo/Ice/applet/README b/java/demo/Ice/applet/README new file mode 100644 index 00000000000..dbf2e18ff20 --- /dev/null +++ b/java/demo/Ice/applet/README @@ -0,0 +1,52 @@ +This demo presents an unsigned applet that shows how to make +asynchronous Ice invocations in a graphical application. It also +demonstrates how to configure IceSSL using a resource file as the +keystore. + +The demo includes a start page (hello.html) that you will need to +publish on a web server. This page assumes that the demo applet is +stored in a fully self-contained archive named Hello.jar. In order to +create this fully self-contained JAR file, you must build the applet +with ProGuard in your CLASSPATH. After a successful build, copy +Hello.jar from this subdirectory to the same directory as hello.html +on your web server. + +NOTE: We recommend using ProGuard 4.3 or later. + +If you did not build the applet with ProGuard in your CLASSPATH, the +Hello.jar archive contains only the applet classes. In this case you +must modify the start page to add Ice.jar to the applet's ARCHIVE +parameter: + + <param name = "archive" value = "Ice.jar, Hello.jar"> + +Alternatively, you can add ProGuard to your CLASSPATH and rebuild the +applet with the following commands: + + ant clean + ant + +To run the demo, you must start a "hello" server on the web server +host. You can use the hello server from the ../hello directory or +a hello server from any other Ice language mapping. Note that you may +need to temporarily relax the firewall restrictions on your web server +host to allow the applet to establish connections to the hello server. +Next, start a web browser and open the hello.html page on your web +server. + +Once the applet has started, verify that the name of your web server +host is correct in the "Hostname" field and press the "Hello World!" +button. You will notice that the server prints a "Hello World!" +message to the console for each invocation. To make other types of Ice +invocations, select a different mode from the combobox. + +The two sliders allow you to experiment with various timeout settings. +The "Timeout" slider determines how long the Ice run time will wait +for an invocation to complete, while the "Delay" slider forces the +server to delay its response. The value of each slider is shown in +seconds. To force a timeout, select a non-zero timeout and set the +delay to be larger than the timeout. The server prints two "Hello +World!" messages in this case because the Slice operation sayHello is +marked as idempotent, meaning that Ice does not need to follow the +at-most-once retry semantics. See the manual for more information +about retry behavior. diff --git a/java/demo/Ice/applet/applet.pro b/java/demo/Ice/applet/applet.pro new file mode 100644 index 00000000000..dae1ea08906 --- /dev/null +++ b/java/demo/Ice/applet/applet.pro @@ -0,0 +1,53 @@ +# ProGuard configuration options + +-keep class HelloApplet + +# Preserve all annotations. +-keepattributes *Annotation* + +# Preserve all native method names and the names of their classes. +-keepclasseswithmembernames class * { + native <methods>; +} + +# Preserve a method that is required in all enumeration classes. +-keepclassmembers class * extends java.lang.Enum { + public **[] values(); +} + +-dontskipnonpubliclibraryclasses +-dontusemixedcaseclassnames +-dontwarn + +# We could reduce the size of the JAR file significantly if we +# enable obfuscation but it would make things like stack traces +# much harder to read. +-dontobfuscate + +-keepclassmembers class * implements java.io.Serializable { + static final long serialVersionUID; + private void writeObject(java.io.ObjectOutputStream); + private void readObject(java.io.ObjectInputStream); + java.lang.Object writeReplace(); + java.lang.Object readResolve(); +} + +# This class is loaded dynamically. +-keep public class IceSSL.PluginFactory { + public *; +} + +# More keeps to suppress Notes + +-keep interface Ice.Communicator +-keep class IceInternal.SelectorHandler + +-keep public class Ice.DispatchStatus { + int __value; + Ice.DispatchStatus[] __values; + int value(); +} + +-keep public class java.net.DatagramSocketImpl { + java.io.FileDescriptor fd; +} diff --git a/java/demo/Ice/applet/build.xml b/java/demo/Ice/applet/build.xml new file mode 100644 index 00000000000..495021109ad --- /dev/null +++ b/java/demo/Ice/applet/build.xml @@ -0,0 +1,98 @@ +<!-- + ********************************************************************** + + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. + + This copy of Ice is licensed to you under the terms described in the + ICE_LICENSE file included in this distribution. + + ********************************************************************** +--> + +<project name="demo_Ice_applet" default="all" basedir="."> + + <!-- set global properties for this build --> + <property name="top.dir" value="../../.."/> + + <!-- import common definitions --> + <import file="${top.dir}/config/common.xml"/> + + <condition property="proguard-found"> + <available classname="proguard.ant.ProGuardTask" classpath="${env.CLASSPATH}" /> + </condition> + + <target name="generate" depends="init"> + <!-- Create the output directory for generated code --> + <mkdir dir="${generated.dir}"/> + <slice2java outputdir="${generated.dir}"> + <meta value="${java2metadata}"/> + <includepath> + <pathelement path="${slice.dir}"/> + </includepath> + <fileset dir="." includes="Hello.ice"/> + </slice2java> + </target> + + <target name="compile" depends="generate"> + <mkdir dir="${class.dir}"/> + <javac srcdir="${generated.dir}" destdir="${class.dir}" + debug="${debug}"> + <classpath refid="ice.classpath"/> + <compilerarg value="${javac.lint}"/> + </javac> + <javac srcdir="." destdir="${class.dir}" + excludes="generated/**" debug="${debug}"> + <classpath refid="ice.classpath"/> + <compilerarg value="${javac.lint}"/> + </javac> + </target> + + <target name="jar" depends="compile" unless="proguard-found"> + <jar jarfile="Hello.jar" basedir="${class.dir}"> + <include name="Demo/**"/> + <include name="HelloApplet*"/> + </jar> + <jar jarfile="Hello.jar" update="true" basedir="${top.dir}/../certs"> + <include name="client.jks"/> + </jar> + </target> + + <target name="proguard-jar" depends="jar" if="proguard-found"> + <condition property="library.jarfiles" value="classes.jar,jsse.jar"> + <os family="mac"/> + </condition> + <condition property="library.jarfiles" value="rt.jar,jsse.jar"> + <!-- Library jar files for Sun JDK --> + <available file="${java.home}/lib/rt.jar"/> + </condition> + <condition property="library.jarfiles" value="vm.jar,core.jar,graphics.jar,security.jar"> + <!-- Library jar files for IBM J9 (from Linux SuSE) --> + <available file="${java.home}/lib/vm.jar"/> + </condition> + <condition property="library.jarpath" value="${java.home}/../Classes" else="${java.home}/lib"> + <os family="mac"/> + </condition> + <pathconvert property="library.jars"> + <filelist dir="${library.jarpath}" files="${library.jarfiles}"/> + </pathconvert> + + <taskdef resource="proguard/ant/task.properties"/> + + <proguard configuration="applet.pro"> + <injar path="${class.dir}"/> + <injar path="${top.dir}/../certs/client.jks"/> + <injar refid="ice.classpath" filter="!META-INF/**"/> + <outjar path="Hello.jar"/> + <libraryjar path="${library.jars}"/> + </proguard> + </target> + + <target name="all" depends="proguard-jar"/> + + <target name="clean"> + <delete file="Hello.jar"/> + <delete dir="${generated.dir}"/> + <delete dir="${class.dir}"/> + </target> + +</project> diff --git a/java/demo/Ice/applet/hello.html b/java/demo/Ice/applet/hello.html new file mode 100644 index 00000000000..c0a48d8f38f --- /dev/null +++ b/java/demo/Ice/applet/hello.html @@ -0,0 +1,35 @@ +<html> +<head> +<title>Ice Hello Applet</title> +</head> + +<body> +<object + classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" + codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=1,5,0,0" + WIDTH = 300 HEIGHT = 175 > + <PARAM NAME = CODE VALUE = "HelloApplet" > + <param name = "type" value = "application/x-java-applet;version=1.5"> + <param name = "scriptable" value = "false"> + <param name = "archive" value = "Hello.jar"> + + <comment> + <embed + type = "application/x-java-applet;version=1.5" \ + CODE = "HelloApplet" \ + ARCHIVE = "Hello.jar" \ + WIDTH = 300 \ + HEIGHT = 175 + scriptable = false + pluginspage = "http://java.sun.com/products/plugin/index.html#download"> + <noembed> + alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." + Your browser is completely ignoring the <APPLET> tag! + </noembed> + </embed> + + </comment> +</object> + +</body> +</html> diff --git a/java/demo/Ice/async/Client.java b/java/demo/Ice/async/Client.java index e21a351ce8d..3d3632edb3d 100644 --- a/java/demo/Ice/async/Client.java +++ b/java/demo/Ice/async/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/async/Hello.ice b/java/demo/Ice/async/Hello.ice index 8eedeac8c76..f3bbe38d5b0 100644 --- a/java/demo/Ice/async/Hello.ice +++ b/java/demo/Ice/async/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -19,7 +19,7 @@ exception RequestCanceledException interface Hello { - ["ami", "amd"] void sayHello(int delay) + ["ami", "amd"] idempotent void sayHello(int delay) throws RequestCanceledException; void shutdown(); diff --git a/java/demo/Ice/async/HelloI.java b/java/demo/Ice/async/HelloI.java index 8104075a027..371bb50405a 100644 --- a/java/demo/Ice/async/HelloI.java +++ b/java/demo/Ice/async/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/async/Server.java b/java/demo/Ice/async/Server.java index 32ec6c61c44..696979091d7 100644 --- a/java/demo/Ice/async/Server.java +++ b/java/demo/Ice/async/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/async/WorkQueue.java b/java/demo/Ice/async/WorkQueue.java index e523330f025..65a1142f0b3 100644 --- a/java/demo/Ice/async/WorkQueue.java +++ b/java/demo/Ice/async/WorkQueue.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/async/build.xml b/java/demo/Ice/async/build.xml index a15d757ebee..8c35a00e1fa 100644 --- a/java/demo/Ice/async/build.xml +++ b/java/demo/Ice/async/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/async/expect.py b/java/demo/Ice/async/expect.py index 02d072ebb8a..ef7c31f4ce3 100755 --- a/java/demo/Ice/async/expect.py +++ b/java/demo/Ice/async/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/Callback.ice b/java/demo/Ice/bidir/Callback.ice index 27946b05bf5..e3b812b06f6 100644 --- a/java/demo/Ice/bidir/Callback.ice +++ b/java/demo/Ice/bidir/Callback.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/CallbackReceiverI.java b/java/demo/Ice/bidir/CallbackReceiverI.java index aa45e98e016..951cb0fda69 100644 --- a/java/demo/Ice/bidir/CallbackReceiverI.java +++ b/java/demo/Ice/bidir/CallbackReceiverI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/CallbackSenderI.java b/java/demo/Ice/bidir/CallbackSenderI.java index 332c1c75614..fd2be87628a 100644 --- a/java/demo/Ice/bidir/CallbackSenderI.java +++ b/java/demo/Ice/bidir/CallbackSenderI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/Client.java b/java/demo/Ice/bidir/Client.java index de4f69f6c2b..60b59377e6d 100644 --- a/java/demo/Ice/bidir/Client.java +++ b/java/demo/Ice/bidir/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/Server.java b/java/demo/Ice/bidir/Server.java index a07555d003a..760b2e997ac 100644 --- a/java/demo/Ice/bidir/Server.java +++ b/java/demo/Ice/bidir/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/build.xml b/java/demo/Ice/bidir/build.xml index ca217abe522..b3fb8fcd131 100644 --- a/java/demo/Ice/bidir/build.xml +++ b/java/demo/Ice/bidir/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/bidir/expect.py b/java/demo/Ice/bidir/expect.py index c232cf161bd..83d8b18e571 100755 --- a/java/demo/Ice/bidir/expect.py +++ b/java/demo/Ice/bidir/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/build.xml b/java/demo/Ice/build.xml index f3f00642dbd..a8f43061344 100644 --- a/java/demo/Ice/build.xml +++ b/java/demo/Ice/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -12,33 +12,35 @@ <project name="demo_Ice" default="all" basedir="."> <target name="all"> + <ant dir="applet"/> + <ant dir="async"/> <ant dir="bidir"/> <ant dir="callback"/> <ant dir="hello"/> <ant dir="invoke"/> <ant dir="latency"/> <ant dir="minimal"/> + <ant dir="multicast"/> <ant dir="nested"/> + <ant dir="session"/> <ant dir="throughput"/> <ant dir="value"/> - <ant dir="session"/> - <ant dir="async"/> - <ant dir="multicast"/> </target> <target name="clean"> + <ant dir="applet" target="clean"/> + <ant dir="async" target="clean"/> <ant dir="bidir" target="clean"/> <ant dir="callback" target="clean"/> <ant dir="hello" target="clean"/> <ant dir="invoke" target="clean"/> <ant dir="latency" target="clean"/> <ant dir="minimal" target="clean"/> + <ant dir="multicast" target="clean"/> <ant dir="nested" target="clean"/> + <ant dir="session" target="clean"/> <ant dir="throughput" target="clean"/> <ant dir="value" target="clean"/> - <ant dir="session" target="clean"/> - <ant dir="async" target="clean"/> - <ant dir="multicast" target="clean"/> </target> </project> diff --git a/java/demo/Ice/callback/Callback.ice b/java/demo/Ice/callback/Callback.ice index c6c54eea561..464d203ddf9 100644 --- a/java/demo/Ice/callback/Callback.ice +++ b/java/demo/Ice/callback/Callback.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/CallbackReceiverI.java b/java/demo/Ice/callback/CallbackReceiverI.java index 8e6ff9bd523..92374aeb750 100644 --- a/java/demo/Ice/callback/CallbackReceiverI.java +++ b/java/demo/Ice/callback/CallbackReceiverI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/CallbackSenderI.java b/java/demo/Ice/callback/CallbackSenderI.java index ef30b2a8532..d30d40b5ce6 100644 --- a/java/demo/Ice/callback/CallbackSenderI.java +++ b/java/demo/Ice/callback/CallbackSenderI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/Client.java b/java/demo/Ice/callback/Client.java index 8785f1bb44c..4928f346213 100644 --- a/java/demo/Ice/callback/Client.java +++ b/java/demo/Ice/callback/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/Server.java b/java/demo/Ice/callback/Server.java index ed9cbcfde2b..293f95f002c 100644 --- a/java/demo/Ice/callback/Server.java +++ b/java/demo/Ice/callback/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/build.xml b/java/demo/Ice/callback/build.xml index df254a00f18..95d2df99ccc 100644 --- a/java/demo/Ice/callback/build.xml +++ b/java/demo/Ice/callback/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/callback/expect.py b/java/demo/Ice/callback/expect.py index 2308e823ddb..4440d182227 100755 --- a/java/demo/Ice/callback/expect.py +++ b/java/demo/Ice/callback/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/hello/Client.java b/java/demo/Ice/hello/Client.java index 13f7caf52c5..ad7b13079b8 100644 --- a/java/demo/Ice/hello/Client.java +++ b/java/demo/Ice/hello/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/hello/Hello.ice b/java/demo/Ice/hello/Hello.ice index 11b714f01c8..bcaed6ad877 100644 --- a/java/demo/Ice/hello/Hello.ice +++ b/java/demo/Ice/hello/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -15,7 +15,7 @@ module Demo interface Hello { - ["cpp:const"] idempotent void sayHello(int delay); + idempotent void sayHello(int delay); void shutdown(); }; diff --git a/java/demo/Ice/hello/HelloI.java b/java/demo/Ice/hello/HelloI.java index 2722e7122fc..92317f21b50 100644 --- a/java/demo/Ice/hello/HelloI.java +++ b/java/demo/Ice/hello/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/hello/Server.java b/java/demo/Ice/hello/Server.java index 6ffab5d02fb..c78c193ebca 100644 --- a/java/demo/Ice/hello/Server.java +++ b/java/demo/Ice/hello/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/hello/build.xml b/java/demo/Ice/hello/build.xml index b18621f16a4..7ea82eccc29 100644 --- a/java/demo/Ice/hello/build.xml +++ b/java/demo/Ice/hello/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/hello/expect.py b/java/demo/Ice/hello/expect.py index def12793698..d2bef70d87f 100755 --- a/java/demo/Ice/hello/expect.py +++ b/java/demo/Ice/hello/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/Client.java b/java/demo/Ice/invoke/Client.java index 9817c168686..8ab0ea28158 100644 --- a/java/demo/Ice/invoke/Client.java +++ b/java/demo/Ice/invoke/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/Printer.ice b/java/demo/Ice/invoke/Printer.ice index dbc12f15b46..ed29207f5e0 100644 --- a/java/demo/Ice/invoke/Printer.ice +++ b/java/demo/Ice/invoke/Printer.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/PrinterI.java b/java/demo/Ice/invoke/PrinterI.java index f7a6b02c8ae..d117bc992ae 100644 --- a/java/demo/Ice/invoke/PrinterI.java +++ b/java/demo/Ice/invoke/PrinterI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/Server.java b/java/demo/Ice/invoke/Server.java index fb502c3cee5..a4008f976cc 100644 --- a/java/demo/Ice/invoke/Server.java +++ b/java/demo/Ice/invoke/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/build.xml b/java/demo/Ice/invoke/build.xml index c42fa4c8eb7..9f7ddd08ef2 100644 --- a/java/demo/Ice/invoke/build.xml +++ b/java/demo/Ice/invoke/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/invoke/expect.py b/java/demo/Ice/invoke/expect.py index 0f0b9ac6995..23a45bb78dd 100755 --- a/java/demo/Ice/invoke/expect.py +++ b/java/demo/Ice/invoke/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/latency/Client.java b/java/demo/Ice/latency/Client.java index 4f591420581..6b232ca5490 100644 --- a/java/demo/Ice/latency/Client.java +++ b/java/demo/Ice/latency/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/latency/Latency.ice b/java/demo/Ice/latency/Latency.ice index 3a6bdad87ce..d4d6c02743f 100644 --- a/java/demo/Ice/latency/Latency.ice +++ b/java/demo/Ice/latency/Latency.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/latency/Server.java b/java/demo/Ice/latency/Server.java index 0e4f6e74814..c3b7e1720a5 100644 --- a/java/demo/Ice/latency/Server.java +++ b/java/demo/Ice/latency/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/latency/build.xml b/java/demo/Ice/latency/build.xml index 6c9e24aa9e3..bce2e06d80b 100644 --- a/java/demo/Ice/latency/build.xml +++ b/java/demo/Ice/latency/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/latency/expect.py b/java/demo/Ice/latency/expect.py index 80bdfe0b32f..153c06ed927 100755 --- a/java/demo/Ice/latency/expect.py +++ b/java/demo/Ice/latency/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/Client.java b/java/demo/Ice/minimal/Client.java index f6ab306ae9e..6693f423a46 100644 --- a/java/demo/Ice/minimal/Client.java +++ b/java/demo/Ice/minimal/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/Hello.ice b/java/demo/Ice/minimal/Hello.ice index 71cff05a221..6cd2473fc45 100644 --- a/java/demo/Ice/minimal/Hello.ice +++ b/java/demo/Ice/minimal/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/HelloI.java b/java/demo/Ice/minimal/HelloI.java index 3c016d99b0d..ed7a822321b 100644 --- a/java/demo/Ice/minimal/HelloI.java +++ b/java/demo/Ice/minimal/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/Server.java b/java/demo/Ice/minimal/Server.java index 8082adbff22..240f3caed6c 100644 --- a/java/demo/Ice/minimal/Server.java +++ b/java/demo/Ice/minimal/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/build.xml b/java/demo/Ice/minimal/build.xml index 7592eca1991..a3a310c0749 100644 --- a/java/demo/Ice/minimal/build.xml +++ b/java/demo/Ice/minimal/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/minimal/expect.py b/java/demo/Ice/minimal/expect.py index 9af59dbe8d8..3273aaa2290 100755 --- a/java/demo/Ice/minimal/expect.py +++ b/java/demo/Ice/minimal/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/Client.java b/java/demo/Ice/multicast/Client.java index fa29e22739a..da1afeb93fd 100644 --- a/java/demo/Ice/multicast/Client.java +++ b/java/demo/Ice/multicast/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/DiscoverI.java b/java/demo/Ice/multicast/DiscoverI.java index 307e2fe5a44..7a222febdc6 100644 --- a/java/demo/Ice/multicast/DiscoverI.java +++ b/java/demo/Ice/multicast/DiscoverI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/DiscoverReplyI.java b/java/demo/Ice/multicast/DiscoverReplyI.java index 6a09ec53b48..bc4bd718711 100644 --- a/java/demo/Ice/multicast/DiscoverReplyI.java +++ b/java/demo/Ice/multicast/DiscoverReplyI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/Discovery.ice b/java/demo/Ice/multicast/Discovery.ice index d8beb26a286..4dd25aef7f7 100644 --- a/java/demo/Ice/multicast/Discovery.ice +++ b/java/demo/Ice/multicast/Discovery.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/Hello.ice b/java/demo/Ice/multicast/Hello.ice index 871a5123e30..6cd2473fc45 100644 --- a/java/demo/Ice/multicast/Hello.ice +++ b/java/demo/Ice/multicast/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -15,7 +15,7 @@ module Demo interface Hello { - ["cpp:const"] idempotent void sayHello(); + idempotent void sayHello(); }; }; diff --git a/java/demo/Ice/multicast/HelloI.java b/java/demo/Ice/multicast/HelloI.java index 3c016d99b0d..ed7a822321b 100644 --- a/java/demo/Ice/multicast/HelloI.java +++ b/java/demo/Ice/multicast/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/Server.java b/java/demo/Ice/multicast/Server.java index 56f4a3611a9..6e08c075c7d 100644 --- a/java/demo/Ice/multicast/Server.java +++ b/java/demo/Ice/multicast/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/build.xml b/java/demo/Ice/multicast/build.xml index 192dd9f5b06..18f3ab1fbd9 100644 --- a/java/demo/Ice/multicast/build.xml +++ b/java/demo/Ice/multicast/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/multicast/expect.py b/java/demo/Ice/multicast/expect.py index a39fe6f0f3c..5addb96eb0a 100755 --- a/java/demo/Ice/multicast/expect.py +++ b/java/demo/Ice/multicast/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/Client.java b/java/demo/Ice/nested/Client.java index 3fb455eeb5c..6e8c5be40ee 100644 --- a/java/demo/Ice/nested/Client.java +++ b/java/demo/Ice/nested/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/Nested.ice b/java/demo/Ice/nested/Nested.ice index fd5138e14c1..bd245a16432 100644 --- a/java/demo/Ice/nested/Nested.ice +++ b/java/demo/Ice/nested/Nested.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/NestedI.java b/java/demo/Ice/nested/NestedI.java index f9be2b15bfe..023cffce52f 100644 --- a/java/demo/Ice/nested/NestedI.java +++ b/java/demo/Ice/nested/NestedI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/Server.java b/java/demo/Ice/nested/Server.java index a7ac36bd3fa..019c790c3b7 100644 --- a/java/demo/Ice/nested/Server.java +++ b/java/demo/Ice/nested/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/build.xml b/java/demo/Ice/nested/build.xml index fd544a6579b..af14c38b0d9 100644 --- a/java/demo/Ice/nested/build.xml +++ b/java/demo/Ice/nested/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/nested/expect.py b/java/demo/Ice/nested/expect.py index fc0a2a3bdd4..aa7416e60dd 100755 --- a/java/demo/Ice/nested/expect.py +++ b/java/demo/Ice/nested/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/Client.java b/java/demo/Ice/session/Client.java index e880dec4545..683a8d4f5ed 100644 --- a/java/demo/Ice/session/Client.java +++ b/java/demo/Ice/session/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/HelloI.java b/java/demo/Ice/session/HelloI.java index 220aa1936ae..02ff456c7d3 100644 --- a/java/demo/Ice/session/HelloI.java +++ b/java/demo/Ice/session/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/ReapThread.java b/java/demo/Ice/session/ReapThread.java index 88ffeeebf4f..bc0eabd7941 100644 --- a/java/demo/Ice/session/ReapThread.java +++ b/java/demo/Ice/session/ReapThread.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/Server.java b/java/demo/Ice/session/Server.java index 866bd9aa718..ddeda924c92 100644 --- a/java/demo/Ice/session/Server.java +++ b/java/demo/Ice/session/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/Session.ice b/java/demo/Ice/session/Session.ice index 1ef9d6ece54..dc1ca46fb15 100644 --- a/java/demo/Ice/session/Session.ice +++ b/java/demo/Ice/session/Session.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/SessionFactoryI.java b/java/demo/Ice/session/SessionFactoryI.java index 4ac1124c9e7..de00295e2ee 100644 --- a/java/demo/Ice/session/SessionFactoryI.java +++ b/java/demo/Ice/session/SessionFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/SessionI.java b/java/demo/Ice/session/SessionI.java index 85e9c9559d2..d57f896d4d1 100644 --- a/java/demo/Ice/session/SessionI.java +++ b/java/demo/Ice/session/SessionI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/build.xml b/java/demo/Ice/session/build.xml index b808a375af0..989954a31ee 100644 --- a/java/demo/Ice/session/build.xml +++ b/java/demo/Ice/session/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/session/expect.py b/java/demo/Ice/session/expect.py index 4c043efa96b..7e5c2f3321a 100755 --- a/java/demo/Ice/session/expect.py +++ b/java/demo/Ice/session/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/Client.java b/java/demo/Ice/throughput/Client.java index 8f6a4176705..d9a73f4ead3 100644 --- a/java/demo/Ice/throughput/Client.java +++ b/java/demo/Ice/throughput/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/Server.java b/java/demo/Ice/throughput/Server.java index 66a13fb219f..040c748ab8c 100644 --- a/java/demo/Ice/throughput/Server.java +++ b/java/demo/Ice/throughput/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/Throughput.ice b/java/demo/Ice/throughput/Throughput.ice index 9fd7decd49d..f61512e4e7a 100644 --- a/java/demo/Ice/throughput/Throughput.ice +++ b/java/demo/Ice/throughput/Throughput.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/ThroughputI.java b/java/demo/Ice/throughput/ThroughputI.java index 27698a2f250..ac7d8b8da1f 100644 --- a/java/demo/Ice/throughput/ThroughputI.java +++ b/java/demo/Ice/throughput/ThroughputI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/build.xml b/java/demo/Ice/throughput/build.xml index 13597eed3c3..c6f86fdf086 100644 --- a/java/demo/Ice/throughput/build.xml +++ b/java/demo/Ice/throughput/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/throughput/expect.py b/java/demo/Ice/throughput/expect.py index e2221bedb12..fd4dfe1205d 100755 --- a/java/demo/Ice/throughput/expect.py +++ b/java/demo/Ice/throughput/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/Client.java b/java/demo/Ice/value/Client.java index dfd8ca53e07..dbac804ad37 100644 --- a/java/demo/Ice/value/Client.java +++ b/java/demo/Ice/value/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/DerivedPrinterI.java b/java/demo/Ice/value/DerivedPrinterI.java index b55b1cdedd0..d9cff295a4c 100644 --- a/java/demo/Ice/value/DerivedPrinterI.java +++ b/java/demo/Ice/value/DerivedPrinterI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/InitialI.java b/java/demo/Ice/value/InitialI.java index e358db1b7e8..6e09e66b1a4 100644 --- a/java/demo/Ice/value/InitialI.java +++ b/java/demo/Ice/value/InitialI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -9,7 +9,7 @@ import Demo.*; -class InitialI extends Initial +class InitialI extends _InitialDisp { InitialI(Ice.ObjectAdapter adapter) { diff --git a/java/demo/Ice/value/ObjectFactory.java b/java/demo/Ice/value/ObjectFactory.java index a0699d4caa7..995d00bbee5 100644 --- a/java/demo/Ice/value/ObjectFactory.java +++ b/java/demo/Ice/value/ObjectFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/PrinterI.java b/java/demo/Ice/value/PrinterI.java index a87ba97786e..313d2aed6d1 100644 --- a/java/demo/Ice/value/PrinterI.java +++ b/java/demo/Ice/value/PrinterI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/Server.java b/java/demo/Ice/value/Server.java index 0610a686f73..fbfff3ecaa1 100644 --- a/java/demo/Ice/value/Server.java +++ b/java/demo/Ice/value/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/Value.ice b/java/demo/Ice/value/Value.ice index aa35ff3c6da..fe8aefd3e22 100644 --- a/java/demo/Ice/value/Value.ice +++ b/java/demo/Ice/value/Value.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -35,7 +35,7 @@ exception DerivedPrinterException DerivedPrinter derived; }; -class Initial +interface Initial { Simple getSimple(); void getPrinter(out Printer impl, out Printer* proxy); diff --git a/java/demo/Ice/value/build.xml b/java/demo/Ice/value/build.xml index a691fff2f1d..2bd6e425085 100644 --- a/java/demo/Ice/value/build.xml +++ b/java/demo/Ice/value/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/Ice/value/expect.py b/java/demo/Ice/value/expect.py index ae329d2f0bb..3fe8f090887 100755 --- a/java/demo/Ice/value/expect.py +++ b/java/demo/Ice/value/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/build.xml b/java/demo/IceBox/build.xml index 12109532630..72e130d12e3 100644 --- a/java/demo/IceBox/build.xml +++ b/java/demo/IceBox/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/hello/Client.java b/java/demo/IceBox/hello/Client.java index 70f5ce6af4b..88da12d04d1 100644 --- a/java/demo/IceBox/hello/Client.java +++ b/java/demo/IceBox/hello/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/hello/Hello.ice b/java/demo/IceBox/hello/Hello.ice index 871a5123e30..6cd2473fc45 100644 --- a/java/demo/IceBox/hello/Hello.ice +++ b/java/demo/IceBox/hello/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -15,7 +15,7 @@ module Demo interface Hello { - ["cpp:const"] idempotent void sayHello(); + idempotent void sayHello(); }; }; diff --git a/java/demo/IceBox/hello/HelloI.java b/java/demo/IceBox/hello/HelloI.java index 3c016d99b0d..ed7a822321b 100644 --- a/java/demo/IceBox/hello/HelloI.java +++ b/java/demo/IceBox/hello/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/hello/HelloServiceI.java b/java/demo/IceBox/hello/HelloServiceI.java index 3672123510e..ccd01ca6e64 100644 --- a/java/demo/IceBox/hello/HelloServiceI.java +++ b/java/demo/IceBox/hello/HelloServiceI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/hello/build.xml b/java/demo/IceBox/hello/build.xml index 09bd4202e7b..7473dc3f874 100644 --- a/java/demo/IceBox/hello/build.xml +++ b/java/demo/IceBox/hello/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceBox/hello/expect.py b/java/demo/IceBox/hello/expect.py index 12510976446..c13dfa1ac75 100755 --- a/java/demo/IceBox/hello/expect.py +++ b/java/demo/IceBox/hello/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/build.xml b/java/demo/IceGrid/build.xml index 1807ae66bab..2fc4a08279a 100644 --- a/java/demo/IceGrid/build.xml +++ b/java/demo/IceGrid/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/icebox/Client.java b/java/demo/IceGrid/icebox/Client.java index ce24db7b92e..4a45de3203c 100644 --- a/java/demo/IceGrid/icebox/Client.java +++ b/java/demo/IceGrid/icebox/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/icebox/Hello.ice b/java/demo/IceGrid/icebox/Hello.ice index ac9d5f5283e..6cd2473fc45 100644 --- a/java/demo/IceGrid/icebox/Hello.ice +++ b/java/demo/IceGrid/icebox/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -15,7 +15,7 @@ module Demo interface Hello { - void sayHello(); + idempotent void sayHello(); }; }; diff --git a/java/demo/IceGrid/icebox/HelloI.java b/java/demo/IceGrid/icebox/HelloI.java index f0230074119..56e465be338 100644 --- a/java/demo/IceGrid/icebox/HelloI.java +++ b/java/demo/IceGrid/icebox/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/icebox/HelloServiceI.java b/java/demo/IceGrid/icebox/HelloServiceI.java index caff9eea30d..ece28a22ff2 100644 --- a/java/demo/IceGrid/icebox/HelloServiceI.java +++ b/java/demo/IceGrid/icebox/HelloServiceI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/icebox/build.xml b/java/demo/IceGrid/icebox/build.xml index 2152a64f35c..b16d4e53d1e 100644 --- a/java/demo/IceGrid/icebox/build.xml +++ b/java/demo/IceGrid/icebox/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/icebox/expect.py b/java/demo/IceGrid/icebox/expect.py index 8125bcf3651..8344d08dff7 100755 --- a/java/demo/IceGrid/icebox/expect.py +++ b/java/demo/IceGrid/icebox/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/Client.java b/java/demo/IceGrid/simple/Client.java index daebb833df1..9a76167a18a 100644 --- a/java/demo/IceGrid/simple/Client.java +++ b/java/demo/IceGrid/simple/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/Hello.ice b/java/demo/IceGrid/simple/Hello.ice index b30e06e02fc..4b123a06908 100644 --- a/java/demo/IceGrid/simple/Hello.ice +++ b/java/demo/IceGrid/simple/Hello.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/HelloI.java b/java/demo/IceGrid/simple/HelloI.java index ab555d69478..d3f06d45700 100644 --- a/java/demo/IceGrid/simple/HelloI.java +++ b/java/demo/IceGrid/simple/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/Server.java b/java/demo/IceGrid/simple/Server.java index 9c5455f68dc..d95efda0502 100644 --- a/java/demo/IceGrid/simple/Server.java +++ b/java/demo/IceGrid/simple/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/application.xml b/java/demo/IceGrid/simple/application.xml index 1047fde8342..49e97cc7b2f 100644 --- a/java/demo/IceGrid/simple/application.xml +++ b/java/demo/IceGrid/simple/application.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/application_with_replication.xml b/java/demo/IceGrid/simple/application_with_replication.xml index 9924c17bdf7..36b9a2f666b 100644 --- a/java/demo/IceGrid/simple/application_with_replication.xml +++ b/java/demo/IceGrid/simple/application_with_replication.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/application_with_template.xml b/java/demo/IceGrid/simple/application_with_template.xml index 067a70b67a6..ff33febfa29 100644 --- a/java/demo/IceGrid/simple/application_with_template.xml +++ b/java/demo/IceGrid/simple/application_with_template.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/build.xml b/java/demo/IceGrid/simple/build.xml index 0705fc6ef48..fee773495bb 100644 --- a/java/demo/IceGrid/simple/build.xml +++ b/java/demo/IceGrid/simple/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceGrid/simple/expect.py b/java/demo/IceGrid/simple/expect.py index 556dfcfb2a5..e9e6a50b6eb 100755 --- a/java/demo/IceGrid/simple/expect.py +++ b/java/demo/IceGrid/simple/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/build.xml b/java/demo/IceStorm/build.xml index 8ce0caa73ec..d406b7dffab 100644 --- a/java/demo/IceStorm/build.xml +++ b/java/demo/IceStorm/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/clock/Clock.ice b/java/demo/IceStorm/clock/Clock.ice index 284e39a1630..d4a526884cf 100644 --- a/java/demo/IceStorm/clock/Clock.ice +++ b/java/demo/IceStorm/clock/Clock.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/clock/Publisher.java b/java/demo/IceStorm/clock/Publisher.java index 5078748baf2..198023a0baf 100644 --- a/java/demo/IceStorm/clock/Publisher.java +++ b/java/demo/IceStorm/clock/Publisher.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/clock/Subscriber.java b/java/demo/IceStorm/clock/Subscriber.java index 7fac97459ec..daee10a6e7e 100644 --- a/java/demo/IceStorm/clock/Subscriber.java +++ b/java/demo/IceStorm/clock/Subscriber.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/clock/build.xml b/java/demo/IceStorm/clock/build.xml index 18de5a55cf9..c2a6da4f215 100644 --- a/java/demo/IceStorm/clock/build.xml +++ b/java/demo/IceStorm/clock/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/IceStorm/clock/expect.py b/java/demo/IceStorm/clock/expect.py index 937a7af3ca1..4991d9250f6 100755 --- a/java/demo/IceStorm/clock/expect.py +++ b/java/demo/IceStorm/clock/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/build.xml b/java/demo/book/build.xml index 4675f1d0e56..997d62a507b 100644 --- a/java/demo/book/build.xml +++ b/java/demo/book/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/evictor/LinkedList.java b/java/demo/book/evictor/LinkedList.java index 28ec1d75681..4400329ee0b 100644 --- a/java/demo/book/evictor/LinkedList.java +++ b/java/demo/book/evictor/LinkedList.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/Client.java b/java/demo/book/freeze_filesystem/Client.java index 01aac52f880..b665940d541 100644 --- a/java/demo/book/freeze_filesystem/Client.java +++ b/java/demo/book/freeze_filesystem/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/DirectoryI.java b/java/demo/book/freeze_filesystem/DirectoryI.java index d8fe5a312a9..4396b65a407 100644 --- a/java/demo/book/freeze_filesystem/DirectoryI.java +++ b/java/demo/book/freeze_filesystem/DirectoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/FileI.java b/java/demo/book/freeze_filesystem/FileI.java index 09db1e60320..12c92654a1b 100644 --- a/java/demo/book/freeze_filesystem/FileI.java +++ b/java/demo/book/freeze_filesystem/FileI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/Filesystem.ice b/java/demo/book/freeze_filesystem/Filesystem.ice index b8b5b38d351..2e48dece6e3 100644 --- a/java/demo/book/freeze_filesystem/Filesystem.ice +++ b/java/demo/book/freeze_filesystem/Filesystem.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/NodeFactory.java b/java/demo/book/freeze_filesystem/NodeFactory.java index 74982387cac..9dd3ab922ed 100644 --- a/java/demo/book/freeze_filesystem/NodeFactory.java +++ b/java/demo/book/freeze_filesystem/NodeFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -14,11 +14,11 @@ public class NodeFactory implements Ice.ObjectFactory public Ice.Object create(String type) { - if(type.equals("::Filesystem::PersistentFile")) + if(type.equals(PersistentFile.ice_staticId())) { return new FileI(); } - else if(type.equals("::Filesystem::PersistentDirectory")) + else if(type.equals(PersistentDirectory.ice_staticId())) { return new DirectoryI(); } diff --git a/java/demo/book/freeze_filesystem/NodeInitializer.java b/java/demo/book/freeze_filesystem/NodeInitializer.java index b1304afd16e..e09f39c1db5 100644 --- a/java/demo/book/freeze_filesystem/NodeInitializer.java +++ b/java/demo/book/freeze_filesystem/NodeInitializer.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/PersistentFilesystem.ice b/java/demo/book/freeze_filesystem/PersistentFilesystem.ice index 2895d2f5d14..fe0216eb4d2 100644 --- a/java/demo/book/freeze_filesystem/PersistentFilesystem.ice +++ b/java/demo/book/freeze_filesystem/PersistentFilesystem.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/Server.java b/java/demo/book/freeze_filesystem/Server.java index 6e66f3ccb3f..10deb39e8a6 100644 --- a/java/demo/book/freeze_filesystem/Server.java +++ b/java/demo/book/freeze_filesystem/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/build.xml b/java/demo/book/freeze_filesystem/build.xml index b2c9993bb02..3b0e0824433 100644 --- a/java/demo/book/freeze_filesystem/build.xml +++ b/java/demo/book/freeze_filesystem/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/freeze_filesystem/expect.py b/java/demo/book/freeze_filesystem/expect.py index 2eed0ed6846..dcb76d36540 100755 --- a/java/demo/book/freeze_filesystem/expect.py +++ b/java/demo/book/freeze_filesystem/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/Client.java b/java/demo/book/lifecycle/Client.java index 8599d43e81d..710a52649e3 100644 --- a/java/demo/book/lifecycle/Client.java +++ b/java/demo/book/lifecycle/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/FilesystemI/DirectoryI.java b/java/demo/book/lifecycle/FilesystemI/DirectoryI.java index c99ada4112c..f2ff137238d 100644 --- a/java/demo/book/lifecycle/FilesystemI/DirectoryI.java +++ b/java/demo/book/lifecycle/FilesystemI/DirectoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/FilesystemI/FileI.java b/java/demo/book/lifecycle/FilesystemI/FileI.java index cb0fd1b5eec..1dbb8578ab2 100644 --- a/java/demo/book/lifecycle/FilesystemI/FileI.java +++ b/java/demo/book/lifecycle/FilesystemI/FileI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/FilesystemI/NodeI.java b/java/demo/book/lifecycle/FilesystemI/NodeI.java index 35e6d90c28f..22b852a2870 100644 --- a/java/demo/book/lifecycle/FilesystemI/NodeI.java +++ b/java/demo/book/lifecycle/FilesystemI/NodeI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/Grammar.java b/java/demo/book/lifecycle/Grammar.java index 92da79a56d0..e9e94969364 100644 --- a/java/demo/book/lifecycle/Grammar.java +++ b/java/demo/book/lifecycle/Grammar.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/Parser.java b/java/demo/book/lifecycle/Parser.java index 94e4af53654..3bf9e0965dd 100644 --- a/java/demo/book/lifecycle/Parser.java +++ b/java/demo/book/lifecycle/Parser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/Scanner.java b/java/demo/book/lifecycle/Scanner.java index d318ed291f0..3283176018d 100644 --- a/java/demo/book/lifecycle/Scanner.java +++ b/java/demo/book/lifecycle/Scanner.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/Server.java b/java/demo/book/lifecycle/Server.java index c6f681db73a..afa26093a42 100644 --- a/java/demo/book/lifecycle/Server.java +++ b/java/demo/book/lifecycle/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -9,7 +9,7 @@ import FilesystemI.*; -class FilesystemApp extends Ice.Application +class Server extends Ice.Application { public int run(String[] args) @@ -44,14 +44,11 @@ class FilesystemApp extends Ice.Application return 0; } -} -public class Server -{ static public void main(String[] args) { - FilesystemApp app = new FilesystemApp(); + Server app = new Server(); app.main("demo.book.lifecycle.Server", args); } } diff --git a/java/demo/book/lifecycle/Token.java b/java/demo/book/lifecycle/Token.java index 7fe92e242e0..e9b76961ea7 100644 --- a/java/demo/book/lifecycle/Token.java +++ b/java/demo/book/lifecycle/Token.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/build.xml b/java/demo/book/lifecycle/build.xml index 8a6f3b863e3..d2eb8aaed7d 100644 --- a/java/demo/book/lifecycle/build.xml +++ b/java/demo/book/lifecycle/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/lifecycle/expect.py b/java/demo/book/lifecycle/expect.py index 16e70346c88..bc04bcbcfd2 100755 --- a/java/demo/book/lifecycle/expect.py +++ b/java/demo/book/lifecycle/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/Client.java b/java/demo/book/printer/Client.java index c10f90d758f..bb18ab4bc71 100644 --- a/java/demo/book/printer/Client.java +++ b/java/demo/book/printer/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/Printer.ice b/java/demo/book/printer/Printer.ice index 3034d48d42e..f48d35d699f 100755 --- a/java/demo/book/printer/Printer.ice +++ b/java/demo/book/printer/Printer.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/PrinterI.java b/java/demo/book/printer/PrinterI.java index a8395783351..a00699af269 100644 --- a/java/demo/book/printer/PrinterI.java +++ b/java/demo/book/printer/PrinterI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/Server.java b/java/demo/book/printer/Server.java index 76776afbb4a..5d278107c7b 100644 --- a/java/demo/book/printer/Server.java +++ b/java/demo/book/printer/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/build.xml b/java/demo/book/printer/build.xml index bae3f66e824..6c301709715 100755 --- a/java/demo/book/printer/build.xml +++ b/java/demo/book/printer/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/printer/expect.py b/java/demo/book/printer/expect.py index e0313a4ef97..9a2038a091e 100755 --- a/java/demo/book/printer/expect.py +++ b/java/demo/book/printer/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/Client.java b/java/demo/book/simple_filesystem/Client.java index c79d04710e5..fa90748d197 100644 --- a/java/demo/book/simple_filesystem/Client.java +++ b/java/demo/book/simple_filesystem/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/Filesystem.ice b/java/demo/book/simple_filesystem/Filesystem.ice index 9a828640802..0cf8dcc7b1b 100755 --- a/java/demo/book/simple_filesystem/Filesystem.ice +++ b/java/demo/book/simple_filesystem/Filesystem.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/Filesystem/DirectoryI.java b/java/demo/book/simple_filesystem/Filesystem/DirectoryI.java index 016e7ff2275..cd6176f6918 100644 --- a/java/demo/book/simple_filesystem/Filesystem/DirectoryI.java +++ b/java/demo/book/simple_filesystem/Filesystem/DirectoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/Filesystem/FileI.java b/java/demo/book/simple_filesystem/Filesystem/FileI.java index 296bc1aadf4..62708293e40 100644 --- a/java/demo/book/simple_filesystem/Filesystem/FileI.java +++ b/java/demo/book/simple_filesystem/Filesystem/FileI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/Server.java b/java/demo/book/simple_filesystem/Server.java index 831c27354a8..5d4101af9cc 100644 --- a/java/demo/book/simple_filesystem/Server.java +++ b/java/demo/book/simple_filesystem/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/build.xml b/java/demo/book/simple_filesystem/build.xml index 0aeab2be8ea..fce7a7f8981 100755 --- a/java/demo/book/simple_filesystem/build.xml +++ b/java/demo/book/simple_filesystem/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/demo/book/simple_filesystem/expect.py b/java/demo/book/simple_filesystem/expect.py index aecbbc55c55..f0b6d5e7b0a 100755 --- a/java/demo/book/simple_filesystem/expect.py +++ b/java/demo/book/simple_filesystem/expect.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. diff --git a/java/demo/build.xml b/java/demo/build.xml index a4ed891a065..7b33f34e6f2 100644 --- a/java/demo/build.xml +++ b/java/demo/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. |