/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*
*/
// PermSARegTable.java: Periodically reregister registrations.
// Author: James Kempf
// Created On: Thu May 14 14:11:49 1998
// Last Modified By: James Kempf
// Last Modified On: Thu Jan 28 14:53:43 1999
// Update Count: 36
//
/**
* Periodically reregister advertisments in the SA client.
*
* @author Erik Guttman, James Kempf
*/
// 9 hours...
// 4 hours, more or less...
// We use these indicies for record access. We should use a class
// here, but it's another 1K!
start();
}
// We just lock the hashtable when we need to update. Otherwise, we
// get into deadlock if an outgoing request is being made when
// somebody else wants to get into this class to look something
// up.
// Make up a record for the table.
new Object[] {
sr};
// Note that we do not account for multiple nonservice: URLs under
// separate type names, because that is disallowed by the protocol.
}
// Remove
}
// Send off the vector of registations for expired advertisements.
try {
} catch (ServiceLocationException ex) {
ex.getMessage()});
} catch (IllegalArgumentException iae) {
}
}
// Walk the registration table, collecting registrations
// to reregister. We synchronize on this method to close
// the window between when the table is walked and
// when the registration is sent
// during which the client may deregister the URL but
// it is reregistered anyway.
private synchronized void walk() {
Enumeration e;
while (e.hasMoreElements()) {
// If the deadline to refresh passed, then do it.
}
}
}
public void run() {
setName("SLP PermSARegTable");
while (true) {
try {
// Sleep for half the reregistration interval (which itself
// is half the lifetime of the URLs.
} catch (InterruptedException ie) {
}
walk();
}
}
}