corba/src/share/classes/com/sun/corba/se/spi/activation/activation.idl
author ohair
Tue, 25 May 2010 15:52:11 -0700
changeset 5555 b2b5ed3f0d0d
parent 4 02bb8761fcce
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
/*
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     2
 * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
 *
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
 *
5555
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
b2b5ed3f0d0d 6943119: Rebrand source copyright notices
ohair
parents: 4
diff changeset
    23
 * questions.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
 */
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
//
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
module activation {
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
    // Possible values for endpointType argument on Server.getEndpoint()
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
    // If you change the value of this constant then update
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
    // core.EndPoint accordingly.  It has a duplicate definition
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
    // to avoid a compilation dependency.
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
    const string IIOP_CLEAR_TEXT = "IIOP_CLEAR_TEXT";
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
    // REVISIT Use the CORBA 2.3 ORBid if we ever get the Java ORB ID
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
    // issue resolved.
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
    typedef string ORBid;
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
    typedef long ServerId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
    typedef sequence<string> POAName ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
    /** Raised if getEndpoint is called on a server callback object for
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
    * an invalid endpoint type
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
    exception NoSuchEndPoint {} ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
    /**
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
    * Raised if an attempt is made to retrieve ports corresponding to
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
    * non-registered ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
    exception InvalidORBid {} ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
    /** Raised if an operation is attempted against an invalid server ID.
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
    exception ServerNotRegistered {
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
	ServerId serverId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
    /** Raised if an operation is attempted for a server that is not running,
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
    * and the server is required to be running for the operation.
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
    exception ServerNotActive {
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
	ServerId serverId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
    /** Raised if an operation is attempted against a server that is in a 
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
    * hold down state.  A server becomes held down if it fails to activate
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
    * within 10 seconds.
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
    exception ServerHeldDown {
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
	ServerId serverId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
    /** Raised if an attempt is made to activate a server that is already 
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
    * running.
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
    exception ServerAlreadyActive{
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
	ServerId serverId ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
    /** Raised if an attempt is made to register a serverdef with the
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
    * same applicationName as an existing serverdef.
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
    exception ServerAlreadyRegistered {
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
	ServerId serverId;
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
    /** Raised if an attempt is made to install a server that is currently 
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
    * installed.  Note that a newly created server starts out in an uninstalled
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
    * state.
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
    exception ServerAlreadyInstalled {
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
	ServerId serverId;
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
    } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
    /** Raised if an attempt is made to uninstall a server that is currently 
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
    * uninstalled.  Note that a newly created server starts out in an 
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
    * uninstalled
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
    * state.
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
    exception ServerAlreadyUninstalled {
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
	ServerId serverId;
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
    } ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
    /** Raised if an attempt is made to register an invalid serverdef.
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
    exception BadServerDefinition {
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
	string reason;
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
    /** Raised if an attempt is made to register endpoints for the
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
     * same ORB again
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
     */
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
    exception ORBAlreadyRegistered {
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
	ORBid orbId;
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
    typedef long TCPPort ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
    typedef sequence<ServerId> ServerIds;
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
    // passing a struct containing endpointType and port-#s
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
    struct EndPointInfo {
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
	string endpointType;
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
	TCPPort port;
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
    typedef sequence<EndPointInfo> EndpointInfoList;
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
    // struct contain ORB and port info
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
    struct ORBPortInfo {
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
	ORBid orbId;
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
	TCPPort port;
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
    typedef sequence<ORBPortInfo> ORBPortInfoList;
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
    typedef sequence<ORBid> ORBidList;
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    /** Server callback API, passed to Activator in active method.
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
    */
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
    interface Server {
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
	/** Shutdown this server.  Returns after orb.shutdown() completes.
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
	*/
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
	void shutdown();
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
	/** Install the server.  Returns after the install hook completes
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
	* execution in the server.
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
	*/
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
	void install();
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
	/** Uninstall the server.  Returns after the uninstall hook
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
	* completes execution.
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
	*/
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
	void uninstall();
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
    interface Activator {
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
    	// A new ORB started server registers itself with the Activator
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
    	void active(in ServerId serverId, in Server serverObj) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
	    raises (ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
	// Install a particular kind of endpoint
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
	void registerEndpoints( in ServerId serverId, in ORBid orbId, 
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
	    in EndpointInfoList endPointInfo) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
	    raises (ServerNotRegistered,NoSuchEndPoint, ORBAlreadyRegistered) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
        // list active servers
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
	ServerIds getActiveServers();
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
	// If the server is not running, start it up.
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
	void activate(in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
	    raises (ServerAlreadyActive, ServerNotRegistered, ServerHeldDown);
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
	// If the server is running, shut it down
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
	void shutdown(in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
	    raises (ServerNotActive, ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
	// Invoke the server install hook.  If the server is not 
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
	// currently running, this method will activate it.
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
	void install(in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
	    raises (ServerNotRegistered, ServerHeldDown, 
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
		ServerAlreadyInstalled);
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
	// list all registered ORBs for a server
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
	ORBidList getORBNames(in ServerId serverId)
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
	    raises (ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
	// Invoke the server uninstall hook.  If the server is not
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
	// currently running, this method will activate it.
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
	// After this hook completes, the server may still be running.
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
	void uninstall(in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
	    raises (ServerNotRegistered, ServerHeldDown, 
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
		ServerAlreadyUninstalled);
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
    interface Locator {
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
	// struct to return the list of endpoints for a server for a specific
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
	// endpoint
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
	struct ServerLocation {
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
	    string hostname;
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
	    ORBPortInfoList ports;
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
        };
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
	// struct to return the list of endpoints for a server for a specific
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
	// ORB
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
	struct ServerLocationPerORB {
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
	    string hostname;
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
	    EndpointInfoList ports;
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
        };
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
	// locate server - returns the port with a specific type for all registered
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
	// ORBs of an active server.
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
	// Starts the server if it is not already running.
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
	ServerLocation locateServer(
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
	    in ServerId serverId,
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
	    in string endPoint) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
	    raises(NoSuchEndPoint, ServerNotRegistered, ServerHeldDown);
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
	// locate server - returns all ports registered with a specified ORB for
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
	// an active server
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
	// Starts the server if it is not already running.
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
	ServerLocationPerORB locateServerForORB(
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
	    in ServerId serverId,
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
	    in ORBid orbId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
	    raises(InvalidORBid, ServerNotRegistered, ServerHeldDown);
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
	// get the port for the endpoint of the locator
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
	TCPPort getEndpoint(in string endPointType)
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
	    raises(NoSuchEndPoint);
02bb8761fcce Initial load
duke
parents:
diff changeset
   231
02bb8761fcce Initial load
duke
parents:
diff changeset
   232
	// Useful from external BadServerIdHandlers which need
02bb8761fcce Initial load
duke
parents:
diff changeset
   233
	// to pick a particular port type.
02bb8761fcce Initial load
duke
parents:
diff changeset
   234
	TCPPort getServerPortForType(
02bb8761fcce Initial load
duke
parents:
diff changeset
   235
            in ServerLocationPerORB location,
02bb8761fcce Initial load
duke
parents:
diff changeset
   236
	    in string endPointType)
02bb8761fcce Initial load
duke
parents:
diff changeset
   237
	    raises(NoSuchEndPoint);
02bb8761fcce Initial load
duke
parents:
diff changeset
   238
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   239
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
    interface ServerManager : Activator, Locator { };
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
    interface InitialNameService {
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
	exception NameAlreadyBound {};
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
	// bind initial name
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
	void bind (
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
	    in string name,
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
	    in Object obj,
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
	    in boolean isPersistant) raises (NameAlreadyBound);
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
    interface Repository {
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
	// server program definition.  We should make this a ValueType.
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
	struct ServerDef {
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
	    string  applicationName;	// alias used for servers with identical
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
					// serverName values.
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
	    string  serverName;		// Class name of server's main class.
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
	    string  serverClassPath;	// class path used to run the server.
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
	    string  serverArgs;		
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
	    string  serverVmArgs;
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
	};
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
	
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
	// register server definition
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
	// This returns the serverId of the server.  A newly created server is
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
	// always uninstalled.
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
	ServerId registerServer (in ServerDef serverDef) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
	    raises (ServerAlreadyRegistered, BadServerDefinition);
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
	
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
	// unregister server definition
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
	void unregisterServer (in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
	    raises (ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
	// get server definition
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
	ServerDef getServer(in ServerId serverId) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
	    raises (ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
	// Return whether the server has been installed
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
	boolean isInstalled( in ServerId serverId ) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
	    raises (ServerNotRegistered);
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
	// Mark the server as being installed.  Raises ServerAlreadyInstalled
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
	// if the server is currently marked as installed.
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
	void install( in ServerId serverId ) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
	    raises (ServerNotRegistered, ServerAlreadyInstalled) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
02bb8761fcce Initial load
duke
parents:
diff changeset
   287
	// Mark the server as being uninstalled.  Raises ServerAlreadyUninstalled
02bb8761fcce Initial load
duke
parents:
diff changeset
   288
	// if the server is currently marked as uninstalled.
02bb8761fcce Initial load
duke
parents:
diff changeset
   289
	void uninstall( in ServerId serverId ) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   290
	    raises (ServerNotRegistered, ServerAlreadyUninstalled) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   291
02bb8761fcce Initial load
duke
parents:
diff changeset
   292
	// list registered servers
02bb8761fcce Initial load
duke
parents:
diff changeset
   293
	ServerIds listRegisteredServers ();
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
	typedef sequence<string>    StringSeq ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
	// Returns list of ALL applicationNames defined in ServerDefs of registered 
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
	// servers.
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
	StringSeq   getApplicationNames();
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
	// Find the ServerID associated with the given application name.
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
	ServerId getServerID( in string applicationName ) 
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
		raises (ServerNotRegistered) ;
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
    };
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
};