public MBeanInternalNotificationInfo(EventInfo eventInfo, IMBeanInfoFactory factory) { _handlerType = eventInfo.GetAddMethod().GetParameters()[0].ParameterType; _handlerGenericArgument = _handlerType.GetGenericArguments()[0]; if (_handlerType.GetGenericTypeDefinition() == typeof(EventHandler <>) && (typeof(Notification).IsAssignableFrom(_handlerGenericArgument) || typeof(NotificationEventArgs).IsAssignableFrom(_handlerGenericArgument))) { _notifInfo = factory.CreateMBeanNotificationInfo(eventInfo, _handlerType); } else { throw new NotCompliantMBeanException(eventInfo.DeclaringType.AssemblyQualifiedName); } _eventInfo = eventInfo; }
public MBeanInternalNotificationInfo(EventInfo eventInfo, IMBeanInfoFactory factory) { _handlerType = eventInfo.GetAddMethod().GetParameters()[0].ParameterType; _handlerGenericArgument = _handlerType.GetGenericArguments()[0]; if (_handlerType.GetGenericTypeDefinition() == typeof(EventHandler<>) && (typeof(Notification).IsAssignableFrom(_handlerGenericArgument) || typeof(NotificationEventArgs).IsAssignableFrom(_handlerGenericArgument))) { _notifInfo = factory.CreateMBeanNotificationInfo(eventInfo, _handlerType); } else { throw new NotCompliantMBeanException(eventInfo.DeclaringType.AssemblyQualifiedName); } _eventInfo = eventInfo; }
public ObjectName PreRegister(IMBeanServer server, ObjectName name) { _server = server; _ownName = name; MBeanNotificationInfo info = new MBeanNotificationInfo(new string[] { RelationNotification.RelationBasicCreation, RelationNotification.RelationBasicRemoval, RelationNotification.RelationBasicUpdate, RelationNotification.RelationMBeanCreation, RelationNotification.RelationMBeanRemoval, RelationNotification.RelationMBeanUpdate }, typeof(RelationNotification).AssemblyQualifiedName, "Relation notification"); this.Initialize(name, new MBeanNotificationInfo[] { info }); return(name); }
public ObjectName PreRegister(IMBeanServer server, ObjectName name) { _server = server; _ownName = name; MBeanNotificationInfo info = new MBeanNotificationInfo(new string[] { RelationNotification.RelationBasicCreation, RelationNotification.RelationBasicRemoval, RelationNotification.RelationBasicUpdate, RelationNotification.RelationMBeanCreation, RelationNotification.RelationMBeanRemoval, RelationNotification.RelationMBeanUpdate }, typeof(RelationNotification).AssemblyQualifiedName, "Relation notification"); this.Initialize(name, new MBeanNotificationInfo[] { info }); return name; }
public NotificationModelInfoType(MBeanNotificationInfo notificationInfo) : base(notificationInfo) { NotificationType = notificationInfo.NotifTypes.ToArray(); }