eventBeanManufacturer = EventTypeUtility.getManufacturer(eventType, writableProperties, runtime.getServicesContext().getClasspathImportServiceRuntime(), false, runtime.getServicesContext().getEventTypeAvroHandler()).getManufacturer(runtime.getServicesContext().getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { log.info("Unable to create manufacturer for event type: " + e.getMessage(), e); return null;
private static BeanInstantiatorForge resolveFactoryMethod(BeanEventType beanEventType, ClasspathImportService classpathImportService) throws EventBeanManufactureException { String factoryMethodName = beanEventType.getFactoryMethodName(); int lastDotIndex = factoryMethodName.lastIndexOf('.'); if (lastDotIndex == -1) { try { Method method = classpathImportService.resolveMethod(beanEventType.getUnderlyingType(), factoryMethodName, new Class[0], new boolean[0], new boolean[0]); return new BeanInstantiatorForgeByReflection(method); } catch (ClasspathImportException e) { String message = "Failed to resolve configured factory method '" + factoryMethodName + "' expected to exist for class '" + beanEventType.getUnderlyingType() + "'"; log.info(message, e); throw new EventBeanManufactureException(message, e); } } String className = factoryMethodName.substring(0, lastDotIndex); String methodName = factoryMethodName.substring(lastDotIndex + 1); try { Method method = classpathImportService.resolveMethodOverloadChecked(className, methodName, new Class[0], new boolean[0], new boolean[0]); return new BeanInstantiatorForgeByReflection(method); } catch (ClasspathImportException e) { String message = "Failed to resolve configured factory method '" + methodName + "' expected to exist for class '" + className + "'"; log.info(message, e); throw new EventBeanManufactureException(message, e); } } }
eventBeanManufacturer = EventTypeUtility.getManufacturer(eventType, writableProperties, runtime.getServicesContext().getClasspathImportServiceRuntime(), false, runtime.getServicesContext().getEventTypeAvroHandler()).getManufacturer(runtime.getServicesContext().getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { log.info("Unable to create manufacturer for event type: " + e.getMessage(), e); return null;
public static BeanInstantiatorForge makeInstantiator(BeanEventType beanEventType, ClasspathImportService classpathImportService) throws EventBeanManufactureException { // see if we use a factory method if (beanEventType.getFactoryMethodName() != null) { return resolveFactoryMethod(beanEventType, classpathImportService); } // find public ctor ClasspathImportException ctorNotFoundEx; try { classpathImportService.resolveCtor(beanEventType.getUnderlyingType(), new Class[0]); return new BeanInstantiatorForgeByNewInstanceReflection(beanEventType.getUnderlyingType()); } catch (ClasspathImportException ex) { ctorNotFoundEx = ex; } // see if JVM ReflectionFactory (specific to JVM) may handle it if (SUN_JVM_OBJECT_CONSTRUCTOR != null) { Class underlyingType = beanEventType.getUnderlyingType(); return new BeanInstantiatorForgeByCtor(underlyingType); } throw new EventBeanManufactureException("Failed to find no-arg constructor and no factory method has been configured and cannot use Sun-JVM reflection to instantiate object of type " + beanEventType.getUnderlyingType().getName(), ctorNotFoundEx); }
eventManufacturer = EventTypeUtility.getManufacturer(eventType, writableProperties, classpathImportService, false, eventTypeAvroHandler); } catch (EventBeanManufactureException e) { throw new ExprValidationException(e.getMessage(), e);
manufacturer = EventTypeUtility.getManufacturer(outputEventType, writables, statementContext.getClasspathImportServiceRuntime(), false, statementContext.getEventTypeAvroHandler()).getManufacturer(statementContext.getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + outputEventType.getName() + "' cannot be written to: " + e.getMessage(), e);
manufacturer = EventTypeUtility.getManufacturer(outputEventType, writables, statementContext.getClasspathImportServiceRuntime(), false, statementContext.getEventTypeAvroHandler()).getManufacturer(statementContext.getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + outputEventType.getName() + "' cannot be written to: " + e.getMessage(), e);
private FileBeginEndProcessor getBeginEndProcessor(DataFlowOpInitializeContext context, int outputPort) { EventType portEventType = factory.getOutputPortTypes()[outputPort]; Set<WriteablePropertyDescriptor> writeables = EventTypeUtility.getWriteableProperties(portEventType, false, false); List<WriteablePropertyDescriptor> writeableList = new ArrayList<WriteablePropertyDescriptor>(); EventBeanManufacturer manufacturer; if (propertyNameFile != null) { WriteablePropertyDescriptor writeableFile = EventTypeUtility.findWritable(propertyNameFile, writeables); if (writeableFile == null || writeableFile.getType() != String.class) { throw new EPException("Failed to find writable String-type property '" + propertyNameFile + "', is the property read-only?"); } writeableList.add(writeableFile); } try { manufacturer = EventTypeUtility.getManufacturer(portEventType, writeableList.toArray(new WriteablePropertyDescriptor[writeableList.size()]), context.getAgentInstanceContext().getClasspathImportServiceRuntime(), false, context.getAgentInstanceContext().getEventTypeAvroHandler()).getManufacturer(context.getAgentInstanceContext().getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + portEventType.getName() + "' cannot be written to: " + e.getMessage(), e); } return new FileBeginEndProcessorGeneralPurpose(manufacturer); }
manufacturer = EventTypeUtility.getManufacturer(targetType, writtenArray, args.getClasspathImportService(), false, args.getEventTypeAvroHandler()); } catch (EventBeanManufactureException e) { throw new ExprValidationException("Failed to obtain eventbean factory: " + e.getMessage(), e);
private FileBeginEndProcessor getBeginEndProcessor(DataFlowOpInitializeContext context, int outputPort) { EventType portEventType = factory.getOutputPortTypes()[outputPort]; Set<WriteablePropertyDescriptor> writeables = EventTypeUtility.getWriteableProperties(portEventType, false); List<WriteablePropertyDescriptor> writeableList = new ArrayList<WriteablePropertyDescriptor>(); EventBeanManufacturer manufacturer; if (propertyNameFile != null) { WriteablePropertyDescriptor writeableFile = EventTypeUtility.findWritable(propertyNameFile, writeables); if (writeableFile == null || writeableFile.getType() != String.class) { throw new EPException("Failed to find writable String-type property '" + propertyNameFile + "', is the property read-only?"); } writeableList.add(writeableFile); } try { manufacturer = EventTypeUtility.getManufacturer(portEventType, writeableList.toArray(new WriteablePropertyDescriptor[writeableList.size()]), context.getAgentInstanceContext().getClasspathImportServiceRuntime(), false, context.getAgentInstanceContext().getEventTypeAvroHandler()).getManufacturer(context.getAgentInstanceContext().getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + portEventType.getName() + "' cannot be written to: " + e.getMessage(), e); } return new FileBeginEndProcessorGeneralPurpose(manufacturer); }
written.toArray(new WriteablePropertyDescriptor[written.size()]), classpathImportService, true, selectExprForgeContext.getEventTypeAvroHandler()); } catch (EventBeanManufactureException e) { throw new ExprValidationException("Failed to write to type: " + e.getMessage(), e);
written.toArray(new WriteablePropertyDescriptor[written.size()]), classpathImportService, true, null); } catch (EventBeanManufactureException e) { throw new ExprValidationException("Failed to write to type: " + e.getMessage(), e);
eventManufacturer = EventTypeUtility.getManufacturer(eventType, new WriteablePropertyDescriptor[0], classpathImportService, true, eventTypeAvroHandler); } catch (EventBeanManufactureException e) { throw new ExprValidationException(e.getMessage(), e);
containedEventEval = new ContainedEventEvalArrayToEventForge(validatedExprNode.getForge(), manufacturer); } catch (EventBeanManufactureException e) { throw new ExprValidationException("Event type '" + streamEventType.getName() + "' cannot be populated: " + e.getMessage(), e);
eventManufacturer = EventTypeUtility.getManufacturer(eventType, writableProperties, classpathImportService, false, eventTypeAvroHandler); } catch (EventBeanManufactureException e) { throw new ExprValidationException(e.getMessage(), e);
eventBeanManufacturer = EventTypeUtility.getManufacturer(outputEventType, writables, context.getServices().getClasspathImportServiceCompileTime(), false, context.getServices().getEventTypeAvroHandler()); } catch (EventBeanManufactureException e) { throw new ExprValidationException("Cannot manufacture event for the provided type '" + outputEventType.getName() + "': " + e.getMessage(), e);
manufacturer = EventTypeUtility.getManufacturer(outputEventType, writables, statementContext.getClasspathImportServiceRuntime(), false, statementContext.getEventTypeAvroHandler()).getManufacturer(statementContext.getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + outputEventType.getName() + "' cannot be written to: " + e.getMessage(), e);
manufacturer = EventTypeUtility.getManufacturer(outputEventType, writables, statementContext.getClasspathImportServiceRuntime(), false, statementContext.getEventTypeAvroHandler()).getManufacturer(statementContext.getEventBeanTypedEventFactory()); } catch (EventBeanManufactureException e) { throw new EPException("Event type '" + outputEventType.getName() + "' cannot be written to: " + e.getMessage(), e);