// **********************************************************************
//
// Copyright (c) 2003-2010 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.
//
// **********************************************************************
// Ice version 3.4.1
package IceBox;
// <auto-generated>
//
// Generated from file `IceBox.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
/**
* Administers a set of {@link Service} instances.
*
* @see Service
*
**/
public abstract class _ServiceManagerDisp extends Ice.ObjectImpl implements ServiceManager
{
protected void
ice_copyStateFrom(Ice.Object __obj)
throws java.lang.CloneNotSupportedException
{
throw new java.lang.CloneNotSupportedException();
}
public static final String[] __ids =
{
"::Ice::Object",
"::IceBox::ServiceManager"
};
public boolean
ice_isA(String s)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public boolean
ice_isA(String s, Ice.Current __current)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public String[]
ice_ids()
{
return __ids;
}
public String[]
ice_ids(Ice.Current __current)
{
return __ids;
}
public String
ice_id()
{
return __ids[1];
}
public String
ice_id(Ice.Current __current)
{
return __ids[1];
}
public static String
ice_staticId()
{
return __ids[1];
}
/**
* Registers a new observer with the ServiceManager.
*
* @param observer The new observer
*
**/
public final void
addObserver(ServiceObserverPrx observer)
{
addObserver(observer, null);
}
/**
* Returns the checksums for the IceBox Slice definitions.
*
* @return A dictionary mapping Slice type ids to their checksums.
*
**/
public final java.util.Map<java.lang.String, java.lang.String>
getSliceChecksums()
{
return getSliceChecksums(null);
}
/**
* Shut down all services. This causes {@link Service#stop} to be
* invoked on all configured services.
*
**/
public final void
shutdown()
{
shutdown(null);
}
/**
* Start an individual service.
*
* @param service The service name.
*
**/
public final void
startService(String service)
throws AlreadyStartedException,
NoSuchServiceException
{
startService(service, null);
}
/**
* Stop an individual service.
*
* @param service The service name.
*
**/
public final void
stopService(String service)
throws AlreadyStoppedException,
NoSuchServiceException
{
stopService(service, null);
}
public static Ice.DispatchStatus
___getSliceChecksums(ServiceManager __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Idempotent, __current.mode);
__inS.is().skipEmptyEncaps();
IceInternal.BasicStream __os = __inS.os();
java.util.Map<java.lang.String, java.lang.String> __ret = __obj.getSliceChecksums(__current);
Ice.SliceChecksumDictHelper.write(__os, __ret);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus
___startService(ServiceManager __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.is();
__is.startReadEncaps();
String service;
service = __is.readString();
__is.endReadEncaps();
IceInternal.BasicStream __os = __inS.os();
try
{
__obj.startService(service, __current);
return Ice.DispatchStatus.DispatchOK;
}
catch(AlreadyStartedException ex)
{
__os.writeUserException(ex);
return Ice.DispatchStatus.DispatchUserException;
}
catch(NoSuchServiceException ex)
{
__os.writeUserException(ex);
return Ice.DispatchStatus.DispatchUserException;
}
}
public static Ice.DispatchStatus
___stopService(ServiceManager __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.is();
__is.startReadEncaps();
String service;
service = __is.readString();
__is.endReadEncaps();
IceInternal.BasicStream __os = __inS.os();
try
{
__obj.stopService(service, __current);
return Ice.DispatchStatus.DispatchOK;
}
catch(AlreadyStoppedException ex)
{
__os.writeUserException(ex);
return Ice.DispatchStatus.DispatchUserException;
}
catch(NoSuchServiceException ex)
{
__os.writeUserException(ex);
return Ice.DispatchStatus.DispatchUserException;
}
}
public static Ice.DispatchStatus
___addObserver(ServiceManager __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.is();
__is.startReadEncaps();
ServiceObserverPrx observer;
observer = ServiceObserverPrxHelper.__read(__is);
__is.endReadEncaps();
__obj.addObserver(observer, __current);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus
___shutdown(ServiceManager __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
__inS.is().skipEmptyEncaps();
__obj.shutdown(__current);
return Ice.DispatchStatus.DispatchOK;
}
private final static String[] __all =
{
"addObserver",
"getSliceChecksums",
"ice_id",
"ice_ids",
"ice_isA",
"ice_ping",
"shutdown",
"startService",
"stopService"
};
public Ice.DispatchStatus
__dispatch(IceInternal.Incoming in, Ice.Current __current)
{
int pos = java.util.Arrays.binarySearch(__all, __current.operation);
if(pos < 0)
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
switch(pos)
{
case 0:
{
return ___addObserver(this, in, __current);
}
case 1:
{
return ___getSliceChecksums(this, in, __current);
}
case 2:
{
return ___ice_id(this, in, __current);
}
case 3:
{
return ___ice_ids(this, in, __current);
}
case 4:
{
return ___ice_isA(this, in, __current);
}
case 5:
{
return ___ice_ping(this, in, __current);
}
case 6:
{
return ___shutdown(this, in, __current);
}
case 7:
{
return ___startService(this, in, __current);
}
case 8:
{
return ___stopService(this, in, __current);
}
}
assert(false);
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeTypeId(ice_staticId());
__os.startWriteSlice();
__os.endWriteSlice();
super.__write(__os);
}
public void
__read(IceInternal.BasicStream __is, boolean __rid)
{
if(__rid)
{
__is.readTypeId();
}
__is.startReadSlice();
__is.endReadSlice();
super.__read(__is, true);
}
public void
__write(Ice.OutputStream __outS)
{
Ice.MarshalException ex = new Ice.MarshalException();
ex.reason = "type IceBox::ServiceManager was not generated with stream support";
throw ex;
}
public void
__read(Ice.InputStream __inS, boolean __rid)
{
Ice.MarshalException ex = new Ice.MarshalException();
ex.reason = "type IceBox::ServiceManager was not generated with stream support";
throw ex;
}
}