Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServiceImplementationConstructor


                    + _servicePoint.getExtensionPointId());

        Class serviceInterface = _servicePoint.getServiceInterface();
        Class declaredInterface = _servicePoint.getDeclaredInterface();

        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(ServiceModelMessages
                    .factoryReturnedNull(_servicePoint), constructor.getLocation(), null);

        // The factory should provice something that either implements the service interface
        // or the declared interface. Again, they are normally the same, but with services
        // defined in terms of a class (not an interface), the service interface is
        // synthetic, and the declared interface is the actual class.

        if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result)))
            throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface(
                    _servicePoint,
                    result,
                    serviceInterface), constructor.getLocation(), null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here


                    + _servicePoint.getExtensionPointId());

        Class serviceInterface = _servicePoint.getServiceInterface();
        Class declaredInterface = _servicePoint.getDeclaredInterface();

        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(ServiceModelMessages
                    .factoryReturnedNull(_servicePoint), constructor.getLocation(), null);

        // The factory should provice something that either implements the service interface
        // or the declared interface. Again, they are normally the same, but with services
        // defined in terms of a class (not an interface), the service interface is
        // synthetic, and the declared interface is the actual class.

        if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result)))
            throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface(
                    _servicePoint,
                    result,
                    serviceInterface), constructor.getLocation(), null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here

        if (_log.isDebugEnabled())
            _log.debug(
                "Constructing core service implementation for service " + _servicePoint.getExtensionPointId());

        Class serviceType = _servicePoint.getServiceInterface();
        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(
                ServiceModelMessages.factoryReturnedNull(_servicePoint),
                constructor.getLocation(),
                null);

        if (!serviceType.isAssignableFrom(result.getClass()))
            throw new ApplicationRuntimeException(
                ServiceModelMessages.factoryWrongInterface(_servicePoint, result, serviceType),
                constructor.getLocation(),
                null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here

                    + _servicePoint.getExtensionPointId());

        Class serviceInterface = _servicePoint.getServiceInterface();
        Class declaredInterface = _servicePoint.getDeclaredInterface();

        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(ServiceModelMessages
                    .factoryReturnedNull(_servicePoint), constructor.getLocation(), null);

        // The factory should provice something that either implements the service interface
        // or the declared interface. Again, they are normally the same, but with services
        // defined in terms of a class (not an interface), the service interface is
        // synthetic, and the declared interface is the actual class.

        if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result)))
            throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface(
                    _servicePoint,
                    result,
                    serviceInterface), constructor.getLocation(), null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here

        if (_log.isDebugEnabled())
            _log.debug(
                "Constructing core service implementation for service " + _servicePoint.getExtensionPointId());

        Class serviceType = _servicePoint.getServiceInterface();
        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(
                ServiceModelMessages.factoryReturnedNull(_servicePoint),
                constructor.getLocation(),
                null);

        if (!serviceType.isAssignableFrom(result.getClass()))
            throw new ApplicationRuntimeException(
                ServiceModelMessages.factoryWrongInterface(_servicePoint, result, serviceType),
                constructor.getLocation(),
                null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here

                    + _servicePoint.getExtensionPointId());

        Class serviceInterface = _servicePoint.getServiceInterface();
        Class declaredInterface = _servicePoint.getDeclaredInterface();

        ServiceImplementationConstructor constructor = _servicePoint.getServiceConstructor();
        Object result = constructor.constructCoreServiceImplementation();

        if (result == null)
            throw new ApplicationRuntimeException(ServiceModelMessages
                    .factoryReturnedNull(_servicePoint), constructor.getLocation(), null);

        // The factory should provice something that either implements the service interface
        // or the declared interface. Again, they are normally the same, but with services
        // defined in terms of a class (not an interface), the service interface is
        // synthetic, and the declared interface is the actual class.

        if (!(serviceInterface.isInstance(result) || declaredInterface.isInstance(result)))
            throw new ApplicationRuntimeException(ServiceModelMessages.factoryWrongInterface(
                    _servicePoint,
                    result,
                    serviceInterface), constructor.getLocation(), null);

        HiveMind.setLocation(result, constructor.getLocation());

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.internal.ServiceImplementationConstructor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.