Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/processcompound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15940/src/org/smartfrog/sfcore/processcompound
Modified Files:
ProcessCompoundImpl.java
Log Message:
Code format.
Index: ProcessCompoundImpl.java
===================================================================
RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/processcompound/ProcessCompoundImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** ProcessCompoundImpl.java 4 Jun 2004 17:41:08 -0000 1.12
--- ProcessCompoundImpl.java 29 Jun 2004 23:29:40 -0000 1.13
***************
*** 592,599 ****
}
-
/**
* Tries to find an attribute in the local context. If the attribute is not
! * found the thread will wait for a notification from sfNotifySubprocessReady
* or until given timeout expires. Used to wait for a new process
* compound to appear.
--- 592,598 ----
}
/**
* Tries to find an attribute in the local context. If the attribute is not
! * found the thread will wait for a notification from sfNotifySubprocessReady
* or until given timeout expires. Used to wait for a new process
* compound to appear.
***************
*** 607,637 ****
* @throws RemoteException if there is any network or remote error
*/
! public Object sfResolveHereOrWait(Object name, long timeout)
! throws Exception {
! long endTime = (new Date()).getTime() + timeout;
! synchronized (processLocks) {
! while (true) {
! try {
! // try to return the attribute value
! // if name in locks => process not ready, pretend not found...
! if (processLocks.contains(name)) {
! throw SmartFrogResolutionException.notFound(new Reference(name),
! sfCompleteNameSafe());
! }
! else
! return sfResolveHere(name);
! } catch (SmartFrogResolutionException ex) {
! // not found, wait for leftover timeout
! long now = (new Date()).getTime();
! if (now >= endTime) {
! throw ex;
}
- processLocks.add(name);
- processLocks.wait(endTime - now);
}
- }
- }
}
--- 606,636 ----
* @throws RemoteException if there is any network or remote error
*/
! public Object sfResolveHereOrWait(Object name, long timeout) throws
! Exception {
! long endTime = (new Date()).getTime()+timeout;
! synchronized (processLocks) {
! while (true) {
! try {
! // try to return the attribute value
! // if name in locks => process not ready, pretend not found...
! if (processLocks.contains(name)) {
! throw SmartFrogResolutionException.notFound(new
! Reference(name),
! sfCompleteNameSafe());
! } else
! return sfResolveHere(name);
! } catch (SmartFrogResolutionException ex) {
! // not found, wait for leftover timeout
! long now = (new Date()).getTime();
! if (now>=endTime) {
! throw ex;
! }
! processLocks.add(name);
! processLocks.wait(endTime-now);
! }
}
}
}
***************
*** 644,655 ****
*
*/
! public void sfNotifySubprocessReady(String name)
! throws RemoteException {
// Notify any waiting threads that an attribute was added
! synchronized (processLocks) {
! processLocks.remove(name);
! processLocks.notifyAll();
! }
}
--- 643,653 ----
*
*/
! public void sfNotifySubprocessReady(String name) throws RemoteException {
// Notify any waiting threads that an attribute was added
! synchronized (processLocks) {
! processLocks.remove(name);
! processLocks.notifyAll();
! }
}
|