All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.demos.travel.flight.FlightInfoDapServer
java.lang.Object
|
+----java.rmi.server.RemoteObject
|
+----java.rmi.server.RemoteServer
|
+----java.rmi.server.UnicastRemoteObject
|
+----com.ibm.beans.demos.travel.flight.FlightInfoDapServer
- public class FlightInfoDapServer
- extends UnicastRemoteObject
- implements Serializable, FlightInfoDapProperties, FlightInfoDapServerExports
This class is part of the remote travel demo and implements the flight
information data access part (DAP) Server bean. For the remote travel demo,
the flight information data access part (DAP) bean has been divided into
a FlightInfoDapClient bean and a FlightInfoDapServer bean. The FlightInfoDapServer
bean implements the FlightInfoDapProperties interface which contains methods that
are used by the dips from the FlightRules.jar (from the com.ibm.beans.demos.travel.flight.rules
package) to alter the flight data returned from the database query. The FlightInfoDapServerExports
interface is also implemented. This interface contains the methods that are called
on the FlightInfoDapServer from the FlightInfoDapClient to query that database for matching
flights and to reserve a particular flight schedule.
A customizer is provided for this server so that a user can configure whether or not
to access the database via JDBC or to access database values from the FlightResourceBundle.
- See Also:
- FlightInfoDapServerCustomizer, FlightInfoDapServerBeanInfo, FlightInfoDapServerExports, FlightInfoDapClient, FlightInfoDapClientCustomizer, FlightInfoDapClientBeanInfo, FlightInfoDapProperties, FlightInformation, TravelInfoChangedEvent, FlightInfoEvent, FlightRequestedEvent, FlightReservedEvent
-
FlightInfoDapServer()
- Constructs an instance of the FlightInfoDapServer bean.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener to be notified when the SQLString property or the flightInfo property has been changed.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener to be notified when the SQLString property or the
flightInfo property is about to be changed.
-
bindWithRegistry()
- Create and install the security manager and rebind the FlightInfoDapServer name
to this object instance.
-
finalize()
- Unbind the FlightInfoDapServer
-
getbUseJDBC()
- Accessor (get) method for the bUseJDBC property.
-
getdbTableName()
- Accessor (get) method for the dbTableName property.
-
getFlightInfo()
- Accessor (get) method for the flightInfo property.
-
getJDBCURL()
- Accessor (get) method for the JDBCURL property.
-
getSQLString()
- Accessor (get) method for the SQLString property.
-
main(String[])
- Runs the FlightInfoDapServer as an application.
-
queryDataBase(TravelInfoChangedEvent)
- Queries the database to find all of the possible flight
choices that match the user request of origin city, destination
city, departure date, and return date.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener from the notification list.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a listener from the notification list.
-
reserveFlight(FlightRequestedEvent)
- Attempts to reserve the specified flight(s).
-
setbUseJDBC(Boolean)
- Accessor (set) method for the bUseJDBC property.
-
setdbTableName(String)
- Accessor (set) method for the dbTableName property.
-
setFlightInfo(Vector)
- Accessor (set) method for the flightInfo property.
-
setJDBCURL(String)
- Accessor (set) method for the JDBCURL property.
-
setSQLString(String)
- Accessor (set) method for the SQLString property.
FlightInfoDapServer
public FlightInfoDapServer() throws RemoteException
- Constructs an instance of the FlightInfoDapServer bean. The constructor initializes
instance data.
- Throws: RemoteException
- Thrown if registry could not be contacted
main
public static void main(String argv[])
- Runs the FlightInfoDapServer as an application. By default, Beans.instantiate()
is used, passing "com.ibm.beans.demos.travel.flight.FlightInfoDapServer" as
the name of the object to be instantiated; however, if "-dippable" is specified,
it will use "com.ibm.beans.demos.travel.flight.FlightInfoDapServerDippable" as
the name of the object to be instantiated. Note that by using Beans.instantiate,
this allows for a customized version of the FlightInfoDapServer to be used, so
long as it is named FlightInfoDapServer.ser (or FlightInfoDapServerDippable.ser,
if the "-dippable" option is specified).
bindWithRegistry
public void bindWithRegistry()
- Create and install the security manager and rebind the FlightInfoDapServer name
to this object instance.
finalize
protected void finalize()
- Unbind the FlightInfoDapServer
- Overrides:
- finalize in class Object
addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a listener to be notified when the SQLString property or the
flightInfo property is about to be changed.
- Parameters:
- listener - The object to be notified.
removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a listener from the notification list.
- Parameters:
- listener - The object to be removed from the notification list.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener to be notified when the SQLString property or the flightInfo property has been changed.
- Parameters:
- listener - The object to be notified.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener from the notification list.
- Parameters:
- listener - The object to be removed from the notification list.
queryDataBase
public FlightInfoEvent queryDataBase(TravelInfoChangedEvent travelInfoChange) throws RemoteException
- Queries the database to find all of the possible flight
choices that match the user request of origin city, destination
city, departure date, and return date.
- Parameters:
- travelInfoChange - The TravelInfoChanged event containing the travel info
- Returns:
- The FlightInfoEvent containing the flight info
- Throws: RemoteException
- Thrown if registry could not be contacted
reserveFlight
public FlightReservedEvent reserveFlight(FlightRequestedEvent flightRequestedEvent) throws RemoteException
- Attempts to reserve the specified flight(s). This method is invoked by the FlightInfoDapClient
when the Itinerary bean has been wired to the FlightInfoDapClient bean and the user has selected
a preferred itinerary.
- Parameters:
- flightRequestedEvent - The FlightRequestedEvent containing the preferred flight itinerary.
- Returns:
- The FlightReservedEvent containing the reserved flight itinerary.
setFlightInfo
public void setFlightInfo(Vector newValue) throws PropertyVetoException
- Accessor (set) method for the flightInfo property.
- Parameters:
- newValue - A Vector representing the FlightInformation.
- Throws: PropertyVetoException
- Indicates that a constrained property
listener has vetoed the change to the flightInfo property.
getFlightInfo
public Vector getFlightInfo()
- Accessor (get) method for the flightInfo property.
- Returns:
- The Vector containing FlightInformation objects.
setSQLString
public void setSQLString(String SQLString) throws PropertyVetoException
- Accessor (set) method for the SQLString property.
- Parameters:
- SQLString - The String representing the SQL property of the bean.
- Throws: PropertyVetoException
- Indicates that a constrained property
listener has vetoed the change to the SQLString property.
getSQLString
public String getSQLString()
- Accessor (get) method for the SQLString property.
- Returns:
- The String containing the SQL database query
setJDBCURL
public void setJDBCURL(String JDBCURL) throws PropertyVetoException
- Accessor (set) method for the JDBCURL property.
- Parameters:
- JDBCURL - The JDBC URL for the JDBC connection
- Throws: PropertyVetoException
- Indicates that a constrained property
listener has vetoed the change to the JDBCURL property.
getJDBCURL
public String getJDBCURL()
- Accessor (get) method for the JDBCURL property.
- Returns:
- The string containing the JDBCURL value.
setbUseJDBC
public void setbUseJDBC(Boolean bUseJDBC) throws PropertyVetoException
- Accessor (set) method for the bUseJDBC property.
- Parameters:
- bUseJDBC - A boolean that signifies whether a JDBC database or
the hard coded database will be used.
- Throws: PropertyVetoException
- Indicates that a constrained property
listener has vetoed the change to the bUseJDBC property.
getbUseJDBC
public Boolean getbUseJDBC()
- Accessor (get) method for the bUseJDBC property.
- Returns:
- The Boolean object containing the bUseJDBC value.
setdbTableName
public void setdbTableName(String dbTableName) throws PropertyVetoException
- Accessor (set) method for the dbTableName property.
- Parameters:
- dbTableName - The database table name
- Throws: PropertyVetoException
- Indicates that a constrained property
listener has vetoed the change to the dbTableName property.
getdbTableName
public String getdbTableName()
- Accessor (get) method for the dbTableName property.
- Returns:
- The string containing the dbTableName value.
All Packages Class Hierarchy This Package Previous Next Index