Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ApplicationMBeanImpl.java
- *
- * Created on 6 grudzień 2012, 11:59
- */
- package lab7;
- import javax.management.*;
- /**
- * Class ApplicationMBeanImpl
- *
- * @author buharin
- */
- public class ApplicationMBeanImpl implements ApplicationMBeanImplMBean, NotificationEmitter {
- private NotificationBroadcasterSupport broadcaster = new NotificationBroadcasterSupport();
- private long seqNumber;
- /**
- * Attribute : Name
- */
- private String name = "Daniel";
- /**
- * Attribute : Kraj
- */
- private String kraj = "EN";
- /**
- * Attribute : Sex
- */
- private String sex = "M";
- public ApplicationMBeanImpl() {
- }
- /**
- * Get Atrytub opisuje plec
- */
- public String getSex() {
- return sex;
- }
- /**
- * Set Atrytub opisuje plec
- */
- public void setSex(String value) {
- sex = value;
- }
- /**
- * Get Atrybut opisuje imie
- */
- public String getName() {
- return name;
- }
- /**
- * Set Atrybut opisuje imie
- */
- public void setName(String value) {
- name = value;
- }
- /**
- * Get Opisuje kraj
- */
- public String getKraj() {
- return kraj;
- }
- /**
- * Set Opisuje kraj
- */
- public void setKraj(String value) {
- kraj = value;
- }
- public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException {
- broadcaster.addNotificationListener(listener, filter, handback);
- }
- public MBeanNotificationInfo[] getNotificationInfo() {
- return new MBeanNotificationInfo[]{new MBeanNotificationInfo(new String[]{}, javax.management.Notification.class.getName(), "NewNotification Description")};
- }
- public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException {
- broadcaster.removeNotificationListener(listener);
- }
- public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException {
- broadcaster.removeNotificationListener(listener, filter, handback);
- }
- public synchronized long getNextSeqNumber() {
- return seqNumber++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement