public boolean isKnownEndpoint(Endpoint endpoint) { Class[] endpointClasses = getEndpointClasses(); if (endpointClasses != null) { for (int i = 0; i < endpointClasses.length; i++) { Class endpointClass = endpointClasses[i]; if (endpointClass.isInstance(endpoint)) { return true; } } return false; } return true; }
/** * Provides a hook to validate the statically configured endpoint */ protected void validateEndpoint(Endpoint endpoint) throws DeploymentException { if (!isKnownEndpoint(endpoint)) { throw new DeploymentException("The endpoint: " + endpoint + " is not an instance of any of the allowable types: " + Arrays.asList(getEndpointClasses())); } }
/** * Create the service unit manager. * Derived classes should override this method and return a * BaseServiceUnitManager so that the component is able to * handle service unit deployment. * * The default implementation will create a @{link BaseXBeanDeployer} instance * using the value of @{link #getEndpointClasses()} if that method returns a non-null value * otherwise it returns null. * * @return a newly created service unit manager */ protected BaseServiceUnitManager createServiceUnitManager() { Class[] classes = getEndpointClasses(); if (classes == null) { return null; } Deployer[] deployers = new Deployer[] { new BaseXBeanDeployer(this, classes) }; return new BaseServiceUnitManager(this, deployers); }