下面列出了怎么用javax.naming.event.NamingListener的API类实例代码及写法,或者点击链接到github查看源代码。
public void addNamingListener(Name name, String filter, Object[] objects,
SearchControls searchControls, NamingListener namingListener)
throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventDirContext(name).addNamingListener(name, filter, objects, searchControls,
namingListener);
}
public void addNamingListener(String s, String filter, Object[] objects,
SearchControls searchControls, NamingListener namingListener)
throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventDirContext(s).addNamingListener(s, filter, objects, searchControls,
namingListener);
}
public void addNamingListener(Name name, int i, NamingListener namingListener)
throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventContext(name).addNamingListener(name, i, namingListener);
}
public void addNamingListener(String s, int i, NamingListener namingListener)
throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventContext(s).addNamingListener(s, i, namingListener);
}
public void removeNamingListener(NamingListener namingListener) throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventContext().removeNamingListener(namingListener);
}
public void addNamingListener(Name name, String filter, SearchControls searchControls,
NamingListener namingListener) throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventDirContext(name)
.addNamingListener(name, filter, searchControls, namingListener);
}
public void addNamingListener(String s, String filter, SearchControls searchControls,
NamingListener namingListener) throws NamingException {
MicroIntegratorBaseUtils.checkSecurity();
getEventDirContext(s).addNamingListener(s, filter, searchControls, namingListener);
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
RemoveNamingListener(EventContext ctx, NamingListener listener) {
this.ctx = ctx;
this.listener = listener;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
RemoveNamingListener(EventContext ctx, NamingListener listener) {
this.ctx = ctx;
this.listener = listener;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
RemoveNamingListener(EventContext ctx, NamingListener listener) {
this.ctx = ctx;
this.listener = listener;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
RemoveNamingListener(EventContext ctx, NamingListener listener) {
this.ctx = ctx;
this.listener = listener;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
QueueElement(EventObject event, Vector<NamingListener> vector) {
this.event = event;
this.vector = vector;
}
/**
* Enqueue an event.
* @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
* of <tt>NamingEvent</tt> or
* <tt>UnsolicitedNotificatoniEvent</tt>.
* If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
* the corresponding subinterface of <tt>NamingListener</tt>.
* For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
* implement the <tt>ObjectAddedListener</tt> interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a <tt>NamingExceptionEvent</tt>, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}
/**
* Enqueue an event.
* @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
* of <tt>NamingEvent</tt> or
* <tt>UnsolicitedNotificatoniEvent</tt>.
* If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
* the corresponding subinterface of <tt>NamingListener</tt>.
* For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
* implement the <tt>ObjectAddedListener</tt> interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a <tt>NamingExceptionEvent</tt>, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}
/**
* Enqueue an event.
* @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
* of <tt>NamingEvent</tt> or
* <tt>UnsolicitedNotificatoniEvent</tt>.
* If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
* the corresponding subinterface of <tt>NamingListener</tt>.
* For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
* implement the <tt>ObjectAddedListener</tt> interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a <tt>NamingExceptionEvent</tt>, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}
/**
* Enqueue an event.
* @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
* of <tt>NamingEvent</tt> or
* <tt>UnsolicitedNotificatoniEvent</tt>.
* If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
* the corresponding subinterface of <tt>NamingListener</tt>.
* For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
* implement the <tt>ObjectAddedListener</tt> interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a <tt>NamingExceptionEvent</tt>, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}
/**
* Enqueue an event.
* @param event Either a <tt>NamingExceptionEvent</tt> or a subclass
* of <tt>NamingEvent</tt> or
* <tt>UnsolicitedNotificatoniEvent</tt>.
* If it is a subclass of <tt>NamingEvent</tt>, all listeners must implement
* the corresponding subinterface of <tt>NamingListener</tt>.
* For example, for a <tt>ObjectAddedEvent</tt>, all listeners <em>must</em>
* implement the <tt>ObjectAddedListener</tt> interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a <tt>NamingExceptionEvent</tt>, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}
/**
* Enqueue an event.
* @param event Either a {@code NamingExceptionEvent} or a subclass
* of {@code NamingEvent} or
* {@code UnsolicitedNotificationEvent}.
* If it is a subclass of {@code NamingEvent}, all listeners must implement
* the corresponding subinterface of {@code NamingListener}.
* For example, for an {@code ObjectAddedEvent}, all listeners <em>must</em>
* implement the {@code ObjectAddedListener} interface.
* <em>The current implementation does not check this before dispatching
* the event.</em>
* If the event is a {@code NamingExceptionEvent}, then all listeners
* are notified.
* @param vector List of NamingListeners that will be notified of event.
*/
synchronized void enqueue(EventObject event, Vector<NamingListener> vector) {
QueueElement newElt = new QueueElement(event, vector);
if (head == null) {
head = newElt;
tail = newElt;
} else {
newElt.next = head;
head.prev = newElt;
head = newElt;
}
notify();
}