pandora
Class Publish

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--pandora.Publish
All Implemented Interfaces:
java.lang.Runnable

public class Publish
extends java.lang.Thread

Thread that publishes updates on the central server.

Copyright (c) 2002-2003 Alexis Grandemange

This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public License
 as published by the Free Software Foundation; version 2.1 of the
 License.
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 GNU Lesser General Public License for more details.
 A copy of the GNU Lesser General Public License lesser.txt should be
 included in the distribution.

Version:
0, 0, 2
Author:
Alexis Grandemange

Field Summary
private  PageBoxAPI API
          Installation API instance
private  PageBoxLib.LogIF log
          Logging object
private  long period
          Time between two publications
private  boolean toStop
          If true ends the thread
private  UpdateIF ui
          Web service interface
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Publish(java.lang.String workDir, PageBoxAPI API, LogIF log, long period)
          Constructor.
 
Method Summary
 void end()
          Requires the thread termination
 void run()
          Main method of the Publish thread
private  boolean update()
          Checks if commands to publish and publish.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

period

private long period
Time between two publications


API

private PageBoxAPI API
Installation API instance


log

private PageBoxLib.LogIF log
Logging object


ui

private UpdateIF ui
Web service interface


toStop

private boolean toStop
If true ends the thread

Constructor Detail

Publish

public Publish(java.lang.String workDir,
               PageBoxAPI API,
               LogIF log,
               long period)
Constructor. Starts the thread. Set up the Web service stub. Retrieves the url of the central Web service from central.txt.

Parameters:
workDir - Pandora directory (where to find central.txt)
log - logging object
Method Detail

run

public void run()
Main method of the Publish thread

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

end

public void end()
Requires the thread termination


update

private boolean update()
Checks if commands to publish and publish.