static { try { EventSetDescriptor propertyChange = new EventSetDescriptor( BEAN_CLASS, "propertyChange", PropertyChangeListener.class, "propertyChange"); propertyChange.setDisplayName(ResourceBundleLoader.getText("EVT_NAME_PROPERTY_CHANGE")); propertyChange.setShortDescription(ResourceBundleLoader.getText("EVT_DESC_PROPERTY_CHANGE")); eventSetDescriptors_ = new EventSetDescriptor[] {propertyChange}; PropertyDescriptor path = new PropertyDescriptor("path", BEAN_CLASS); path.setBound(true); path.setConstrained(false); path.setDisplayName(ResourceBundleLoader.getText("PROP_NAME_PATH")); path.setShortDescription(ResourceBundleLoader.getText("PROP_DESC_PATH")); PropertyDescriptor system = new PropertyDescriptor("system", BEAN_CLASS); system.setBound(true); system.setConstrained(false); system.setDisplayName(ResourceBundleLoader.getText("PROP_NAME_SYSTEM")); system.setShortDescription(ResourceBundleLoader.getText("PROP_DESC_SYSTEM")); propertyDescriptors_ = new PropertyDescriptor[] {path, system}; } catch (IntrospectionException e) { Trace.log(Trace.ERROR, "Unexpected IntrospectionException:", e); throw new InternalErrorException(InternalErrorException.UNEXPECTED_EXCEPTION); } }
public static void addListener(Object target, Object listener) { try { BeanInfo beanInfo = java.beans.Introspector.getBeanInfo(target.getClass()); for (EventSetDescriptor d : beanInfo.getEventSetDescriptors()) { Class<?> c = d.getListenerType(); if (c.isAssignableFrom(listener.getClass())) { System.out.println("introspector registering for " + d.getName()); d.getAddListenerMethod().invoke(target, listener); } } } catch (Exception e) { throw new RuntimeException(e); } System.out.println( "no appropriate registration method found on " + target.getClass().getName()); // throw new RuntimeException("no appropriate registration method found on " // + target.getClass().getName()); }
public EventSetDescriptor[] getEventSetDescriptors() { try { EventSetDescriptor eventRequestComplete = new EventSetDescriptor( IntegrationObject.CountCourtDateDelete_Access.class, "requestComplete", com.ibm.HostPublisher.IntegrationObject.HPubReqCompleteListener.class, "hPubReqComplete"); eventRequestComplete.setDisplayName("Request has completed Event."); eventRequestComplete.setShortDescription( "This event is sent to notify all listeners that the request has " + "completed and data is available for retrieval."); EventSetDescriptor[] arrayOfESDs = {eventRequestComplete}; return arrayOfESDs; } catch (IntrospectionException e) { System.out.println(e); return null; } }
// ***** ***** public EventSetDescriptor[] getEventSetDescriptors() { try { EventSetDescriptor eventHPubReqComplete = new EventSetDescriptor( com.ibm.HostPublisher.IntegrationObject.HPubCommon.class, "requestComplete", com.ibm.HostPublisher.IntegrationObject.HPubReqCompleteListener.class, "hPubReqComplete"); String reqCompleteName = res.getString("reqCompleteName"); eventHPubReqComplete.setDisplayName(reqCompleteName); String reqCompleteDesc = res.getString("reqCompleteDesc"); eventHPubReqComplete.setShortDescription(reqCompleteDesc); EventSetDescriptor[] arrayOfESDs = {eventHPubReqComplete}; return arrayOfESDs; } catch (IntrospectionException e) { System.out.println(e); return null; } }
/** * Returns true if, at this time, the object will accept a connection according to the supplied * EventSetDescriptor * * @param esd the EventSetDescriptor * @return true if the object will accept a connection */ public boolean connectionAllowed(EventSetDescriptor esd) { return connectionAllowed(esd.getName()); }
// Static initializer. static { try { // Events. EventSetDescriptor event1 = new EventSetDescriptor( beanClass_, "propertyChange", PropertyChangeListener.class, "propertyChange"); event1.setDisplayName(rbl_.getText("EVT_NAME_PROPERTY_CHANGE")); event1.setShortDescription(rbl_.getText("EVT_DESC_PROPERTY_CHANGE")); EventSetDescriptor event2 = new EventSetDescriptor( beanClass_, "actionCompleted", ActionCompletedListener.class, "actionCompleted"); event2.setDisplayName(rbl_.getText("EVT_NAME_ACTION_COMPLETED")); event2.setShortDescription(rbl_.getText("EVT_DESC_ACTION_COMPLETED")); EventSetDescriptor event3 = new EventSetDescriptor( beanClass_, "propertyChange", VetoableChangeListener.class, "vetoableChange"); event3.setDisplayName(rbl_.getText("EVT_NAME_PROPERTY_VETO")); event3.setShortDescription(rbl_.getText("EVT_DESC_PROPERTY_VETO")); events_ = new EventSetDescriptor[] {event1, event2, event3}; // Properties. PropertyDescriptor classPath = new PropertyDescriptor("classPath", beanClass_, "getClassPath", "setClassPath"); classPath.setBound(true); classPath.setConstrained(true); classPath.setDisplayName(rbl_.getText("PROP_NAME_JAC_CLASSPATH")); classPath.setShortDescription(rbl_.getText("PROP_DESC_JAC_CLASSPATH")); PropertyDescriptor classPathSecurityChkLvl = new PropertyDescriptor( "securityCheckLevel", beanClass_, "getSecurityCheckLevel", "setSecurityCheckLevel"); classPathSecurityChkLvl.setBound(true); classPathSecurityChkLvl.setConstrained(true); classPathSecurityChkLvl.setDisplayName(rbl_.getText("PROP_NAME_JAC_SECCHKLVL")); classPathSecurityChkLvl.setShortDescription(rbl_.getText("PROP_DESC_JAC_SECCHKLVL")); PropertyDescriptor garbageCollectInitialSize = new PropertyDescriptor( "garbageCollectionInitialSize", beanClass_, "getGarbageCollectionInitialSize", "setGarbageCollectionInitialSize"); garbageCollectInitialSize.setBound(true); garbageCollectInitialSize.setConstrained(true); garbageCollectInitialSize.setDisplayName(rbl_.getText("PROP_NAME_JAC_GCINIT")); garbageCollectInitialSize.setShortDescription(rbl_.getText("PROP_DESC_JAC_GCINIT")); PropertyDescriptor garbageCollectMaximumSize = new PropertyDescriptor( "garbageCollectionMaximumSize", beanClass_, "getGarbageCollectionMaximumSize", "setGarbageCollectionMaximumSize"); garbageCollectMaximumSize.setBound(true); garbageCollectMaximumSize.setConstrained(true); garbageCollectMaximumSize.setDisplayName(rbl_.getText("PROP_NAME_JAC_GCMAX")); garbageCollectMaximumSize.setShortDescription(rbl_.getText("PROP_DESC_JAC_GCMAX")); PropertyDescriptor garbageCollectionFrequency = new PropertyDescriptor( "garbageCollectionFrequency", beanClass_, "getGarbageCollectionFrequency", "setGarbageCollectionFrequency"); garbageCollectionFrequency.setBound(true); garbageCollectionFrequency.setConstrained(true); garbageCollectionFrequency.setDisplayName(rbl_.getText("PROP_NAME_JAC_GCFREQ")); garbageCollectionFrequency.setShortDescription(rbl_.getText("PROP_DESC_JAC_GCFREQ")); PropertyDescriptor garbageCollectionPriority = new PropertyDescriptor( "garbageCollectionPriority", beanClass_, "getGarbageCollectionPriority", "setGarbageCollectionPriority"); garbageCollectionPriority.setBound(true); garbageCollectionPriority.setConstrained(true); garbageCollectionPriority.setDisplayName(rbl_.getText("PROP_NAME_JAC_GCPRIORITY")); garbageCollectionPriority.setShortDescription(rbl_.getText("PROP_DESC_JAC_GCPRIORITY")); PropertyDescriptor interpret = new PropertyDescriptor("interpret", beanClass_, "getInterpret", "setInterpret"); interpret.setBound(true); interpret.setConstrained(true); interpret.setDisplayName(rbl_.getText("PROP_NAME_JAC_INTERPRET")); interpret.setShortDescription(rbl_.getText("PROP_DESC_JAC_INTERPRET")); PropertyDescriptor javaApplication = new PropertyDescriptor( "javaApplication", beanClass_, "getJavaApplication", "setJavaApplication"); javaApplication.setBound(true); javaApplication.setConstrained(true); javaApplication.setDisplayName(rbl_.getText("PROP_NAME_JAC_JAVAAPP")); javaApplication.setShortDescription(rbl_.getText("PROP_DESC_JAC_JAVAAPP")); PropertyDescriptor optimization = new PropertyDescriptor("optimization", beanClass_, "getOptimization", "setOptimization"); optimization.setBound(true); optimization.setConstrained(true); optimization.setDisplayName(rbl_.getText("PROP_NAME_JAC_OPTIMIZE")); optimization.setShortDescription(rbl_.getText("PROP_DESC_JAC_OPTIMIZE")); PropertyDescriptor option = new PropertyDescriptor("option", beanClass_, "getOptions", "setOptions"); option.setBound(true); option.setConstrained(true); option.setDisplayName(rbl_.getText("PROP_NAME_JAC_OPTION")); option.setShortDescription(rbl_.getText("PROP_DESC_JAC_OPTION")); PropertyDescriptor parameters = new PropertyDescriptor("parameters", beanClass_, "getParameters", "setParameters"); parameters.setBound(true); parameters.setConstrained(true); parameters.setDisplayName(rbl_.getText("PROP_NAME_JAC_PARAMETERS")); parameters.setShortDescription(rbl_.getText("PROP_DESC_JAC_PARAMETERS")); PropertyDescriptor portSearch = new PropertyDescriptor("findPort", beanClass_, "isFindPort", "setFindPort"); portSearch.setBound(true); portSearch.setConstrained(true); portSearch.setDisplayName(rbl_.getText("PROP_NAME_JAC_PORTSEARCH")); portSearch.setShortDescription(rbl_.getText("PROP_DESC_JAC_PORTSEARCH")); properties_ = new PropertyDescriptor[] { classPath, classPathSecurityChkLvl, garbageCollectInitialSize, garbageCollectMaximumSize, garbageCollectionFrequency, garbageCollectionPriority, interpret, javaApplication, parameters, optimization, option, portSearch, }; } catch (IntrospectionException e) { throw new Error(e.toString()); } }
static { try { EventSetDescriptor changed = new EventSetDescriptor( beanClass, "propertyChange", java.beans.PropertyChangeListener.class, "propertyChange"); changed.setDisplayName(loader_.getText("EVT_NAME_PROPERTY_CHANGE")); changed.setShortDescription(loader_.getText("EVT_DESC_PROPERTY_CHANGE")); EventSetDescriptor veto = new EventSetDescriptor( beanClass, "propertyChange", java.beans.VetoableChangeListener.class, "vetoableChange"); veto.setDisplayName(loader_.getText("EVT_NAME_PROPERTY_VETO")); veto.setShortDescription(loader_.getText("EVT_DESC_PROPERTY_VETO")); EventSetDescriptor[] events = {changed, veto}; events_ = events; // ***** PROPERTIES PropertyDescriptor alignment = new PropertyDescriptor("alignment", beanClass, "getAlignment", "setAlignment"); alignment.setBound(true); alignment.setConstrained(true); alignment.setDisplayName(loader_.getText("PROP_NAME_ALIGNMENT")); alignment.setShortDescription(loader_.getText("PROP_HTBL_DESC_ALIGNMENT")); PropertyDescriptor borderWidth = new PropertyDescriptor("borderWidth", beanClass, "getBorderWidth", "setBorderWidth"); borderWidth.setBound(true); borderWidth.setConstrained(true); borderWidth.setDisplayName(loader_.getText("PROP_NAME_BORDERWIDTH")); borderWidth.setShortDescription(loader_.getText("PROP_DESC_BORDERWIDTH")); // PropertyDescriptor caption = new PropertyDescriptor("caption", beanClass, // "getCaption", "setCaption"); Class[] parameterList = {HTMLTableCaption.class}; PropertyDescriptor caption = new PropertyDescriptor( "caption", beanClass.getMethod("getCaption", (java.lang.Class[]) null), beanClass.getMethod("setCaption", parameterList)); // @pdc cast for jdk1.5 caption.setBound(true); caption.setConstrained(true); caption.setDisplayName(loader_.getText("PROP_NAME_CAPTION")); caption.setShortDescription(loader_.getText("PROP_DESC_CAPTION")); PropertyDescriptor cellPadding = new PropertyDescriptor("cellPadding", beanClass, "getCellPadding", "setCellPadding"); cellPadding.setBound(true); cellPadding.setConstrained(true); cellPadding.setDisplayName(loader_.getText("PROP_NAME_CELLPADDING")); cellPadding.setShortDescription(loader_.getText("PROP_DESC_CELLPADDING")); PropertyDescriptor cellSpacing = new PropertyDescriptor("cellSpacing", beanClass, "getCellSpacing", "setCellSpacing"); cellSpacing.setBound(true); cellSpacing.setConstrained(true); cellSpacing.setDisplayName(loader_.getText("PROP_NAME_CELLSPACING")); cellSpacing.setShortDescription(loader_.getText("PROP_DESC_CELLSPACING")); PropertyDescriptor header = new PropertyDescriptor("header", beanClass, "getHeader", "setHeader"); header.setBound(true); header.setConstrained(true); header.setDisplayName(loader_.getText("PROP_NAME_HEADER")); header.setShortDescription(loader_.getText("PROP_DESC_HEADER")); PropertyDescriptor useHeader = new PropertyDescriptor("headerInUse", beanClass, "isHeaderInUse", "setHeaderInUse"); useHeader.setBound(true); useHeader.setConstrained(true); useHeader.setDisplayName(loader_.getText("PROP_NAME_HEADERINUSE")); useHeader.setShortDescription(loader_.getText("PROP_DESC_HEADERINUSE")); PropertyDescriptor width = new PropertyDescriptor("width", beanClass, "getWidth", "setWidth"); width.setBound(true); width.setConstrained(true); width.setDisplayName(loader_.getText("PROP_NAME_WIDTH")); width.setShortDescription(loader_.getText("PROP_HTBL_DESC_WIDTH")); PropertyDescriptor widthInPercent = new PropertyDescriptor( "widthInPercent", beanClass, "isWidthInPercent", "setWidthInPercent"); widthInPercent.setBound(true); widthInPercent.setConstrained(true); widthInPercent.setDisplayName(loader_.getText("PROP_NAME_WPERCENT")); widthInPercent.setShortDescription(loader_.getText("PROP_HTBL_DESC_WPERCENT")); PropertyDescriptor lang = new PropertyDescriptor("lang", beanClass, "getLanguage", "setLanguage"); // $B1A lang.setBound(true); // $B1A lang.setConstrained(true); // $B1A lang.setDisplayName(loader_.getText("PROP_NAME_LANGUAGE")); // $B1A lang.setShortDescription(loader_.getText("PROP_DESC_LANGUAGE")); // $B1A PropertyDescriptor dir = new PropertyDescriptor("dir", beanClass, "getDirection", "setDirection"); // $B1A dir.setBound(true); // $B1A dir.setConstrained(true); // $B1A dir.setDisplayName(loader_.getText("PROP_NAME_DIRECTION")); // $B1A dir.setShortDescription(loader_.getText("PROP_DESC_DIRECTION")); // $B1A PropertyDescriptor useFO = new PropertyDescriptor("useFO", beanClass, "isUseFO", "setUseFO"); // @C1A useFO.setBound(true); // @C1A useFO.setConstrained(false); // @C1A useFO.setDisplayName(loader_.getText("PROP_NAME_FORMATTING_OBJECT")); // @C1A useFO.setShortDescription(loader_.getText("PROP_DESC_FORMATTING_OBJECT")); // @C1A properties_ = new PropertyDescriptor[] { alignment, borderWidth, caption, cellPadding, cellSpacing, header, useHeader, width, widthInPercent, lang, dir, useFO }; // $B1C //@C1A } catch (Exception e) { throw new Error(e.toString()); } }
/** * Returns true, if at the current time, the event described by the supplied event descriptor * could be generated. * * @param esd an <code>EventSetDescriptor</code> value * @return a <code>boolean</code> value */ public boolean eventGeneratable(EventSetDescriptor esd) { String eventName = esd.getName(); return eventGeneratable(eventName); }