/** * Loads the source-side parameter types in the contribution classloader associated with the source component. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws InterceptorCreationException * if an error occurs loading the parameter types */ private List<Class<?>> loadSourceInputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws InterceptorCreationException { try { return ParameterTypeHelper.loadSourceInParameterTypes(definition, loader); } catch (ClassNotFoundException e) { throw new InterceptorCreationException(e); } }
/** * Loads the source-side output parameter types in the contribution classloader associated of the source component. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws InterceptorCreationException * if an error occurs loading the parameter types */ private List<Class<?>> loadSourceOutputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws InterceptorCreationException { List<Class<?>> types = new ArrayList<Class<?>>(); try { Class<?> outParam = ParameterTypeHelper.loadSourceOutputType(definition, loader); types.add(outParam); // TODO handle fault types // Set<Class<?>> faults = ParameterTypeHelper.loadFaultTypes(definition, loader); // types.addAll(faults); } catch (ClassNotFoundException e) { throw new InterceptorCreationException(e); } return types; }
/** * Loads the target-side parameter types in the contribution classloader associated with the target service. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws WiringException if an error occurs loading the parameter types */ private List<Class<?>> loadTargetInputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws WiringException { try { return ParameterTypeHelper.loadTargetInParameterTypes(definition, loader); } catch (ClassNotFoundException e) { throw new WiringException(e); } }
@SuppressWarnings({"unchecked"}) private DataType<?> getEventType(EventStream stream, ClassLoader loader) throws ClassNotFoundException { Class<?> type; List<String> eventTypes = stream.getDefinition().getEventTypes(); if (eventTypes.isEmpty()) { // default to Object if there are no event types type = Object.class; } else { type = ParameterTypeHelper.loadClass(eventTypes.get(0), loader); } return new JavaClass(type); }
/** * Loads the target-side output parameter types in the contribution classloader associated of the target service. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws InterceptorCreationException * if an error occurs loading the parameter types */ private List<Class<?>> loadTargetOutputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws InterceptorCreationException { List<Class<?>> types = new ArrayList<Class<?>>(); try { Class<?> outParam = ParameterTypeHelper.loadTargetOutputType(definition, loader); types.add(outParam); // TODO handle fault types // Set<Class<?>> faults = ParameterTypeHelper.loadFaultTypes(definition, loader); // types.addAll(faults); } catch (ClassNotFoundException e) { throw new InterceptorCreationException(e); } return types; }
@SuppressWarnings({"unchecked"}) private DataType<?> getEventTypeForConnection(ChannelConnection connection, ClassLoader loader) throws BrokerException { PhysicalEventStreamDefinition eventStreamDefinition = connection.getEventStream().getDefinition(); if (!eventStreamDefinition.getEventTypes().isEmpty()) { try { String eventType = eventStreamDefinition.getEventTypes().get(0); Class<?> type = ParameterTypeHelper.loadClass(eventType, loader); return new JavaClass(type); } catch (ClassNotFoundException e) { throw new BrokerException(e); } } else { return new JavaClass<Object>(Object.class); } }
/** * Loads the source-side parameter types in the contribution classloader associated with the source component. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws WiringException if an error occurs loading the parameter types */ private List<Class<?>> loadSourceInputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws WiringException { try { return ParameterTypeHelper.loadSourceInParameterTypes(definition, loader); } catch (ClassNotFoundException e) { throw new WiringException(e); } }
/** * Loads the target-side parameter types in the contribution classloader associated with the target service. * * @param definition the physical operation definition * @param loader the contribution classloader * @return a collection of loaded parameter types * @throws InterceptorCreationException * if an error occurs loading the parameter types */ private List<Class<?>> loadTargetInputTypes(PhysicalOperationDefinition definition, ClassLoader loader) throws InterceptorCreationException { try { return ParameterTypeHelper.loadTargetInParameterTypes(definition, loader); } catch (ClassNotFoundException e) { throw new InterceptorCreationException(e); } }
@SuppressWarnings({"unchecked"}) private List<DataType<?>> createTypes(PhysicalOperationDefinition physicalOperation, ClassLoader loader) throws BrokerException { try { List<DataType<?>> dataTypes = new ArrayList<DataType<?>>(); if (physicalOperation.getSourceParameterTypes().isEmpty()) { // no params dataTypes.add(EMPTY_TYPE); } else { List<Class<?>> types = ParameterTypeHelper.loadSourceInParameterTypes(physicalOperation, loader); for (Class<?> type : types) { dataTypes.add(new JavaClass((type))); } } return dataTypes; } catch (ClassNotFoundException e) { throw new BrokerException("Error transforming parameter", e); } }