org.apache.xbean.kernel
Class InvalidServiceTypeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.xbean.kernel.InvalidServiceTypeException
All Implemented Interfaces:
Serializable

public class InvalidServiceTypeException
extends Exception

Indicates that the service factory returned an object from the createService method that is not an instance of every declared type.

Since:
2.0
Author:
Dain Sundstrom
See Also:
Serialized Form

Constructor Summary
InvalidServiceTypeException(ServiceName serviceName, Class expectedType, Class serviceType)
          Creates an InvalidServiceType caused by the service with the specified name, which returned an object from the createService method of the specified type that is not an instance of the expected type.
 
Method Summary
 Class getExpectedType()
          Gets the type that was expected.
 ServiceName getServiceName()
          Gets the name of the service that returned an object of the wrong type.
 Class getServiceType()
          Gets the actual type of the service returned from the factory.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidServiceTypeException

public InvalidServiceTypeException(ServiceName serviceName,
                                   Class expectedType,
                                   Class serviceType)
Creates an InvalidServiceType caused by the service with the specified name, which returned an object from the createService method of the specified type that is not an instance of the expected type.

Parameters:
serviceName - the name of the service that returned an object of the wrong type
expectedType - the type that was expected
serviceType - the actual type of the service returned from the factory
Method Detail

getServiceName

public ServiceName getServiceName()
Gets the name of the service that returned an object of the wrong type.

Returns:
the name of the service that returned an object of the wrong type

getExpectedType

public Class getExpectedType()
Gets the type that was expected.

Returns:
the type that was expected

getServiceType

public Class getServiceType()
Gets the actual type of the service returned from the factory.

Returns:
the actual type of the service returned from the factory


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.