Package org.spiderwiz.core
This package contains all the building blocks that you need in order to build a fully functional Spiderwiz application. You will find here a short description of the classes and hints how to use them. For a thorough description look at the documentation of each class, and for a detail usage instructions look at our tutorials.
Your starting point is class Main
. Extend it with your own class, in which you will define the
objects that you produce or consume, register object handlers and provide custom initialization code.
Next is to define your data objects library. A Data Object is a class that extends
DataObject
and adds properties for the specific object type. If you are a producer of that
object type, create the object (with Main.createTopLevelObject()
or DataObject.createChild()
) and set its properties, or edit the properties of an existing object, then
commit
the object. If you are a consumer of that object type, implement event
handling methods of the class.
For many applications this is all you need in order to achieve your tasks. Other classes help you in advanced scenarios:
QueryObject
is a subclass of DataObject
designed for
round-trip queries. It has methods for posting a query by a sender and methods for replying to queries by receivers.
Resetter
can be used in case of communication problems, when a consumer detects that an object
stream has gone out of sequence. In that case it sends an object reset request to the producer, which can use the provided
Resetter
for moderated streaming of reset data.
Filter
is a base class for a filtering object that you need to use with
DataObject.getFilteredChildren()
.
An extension of it is provided - CatchAllFilter
- that catches all data objects of a
specific type.
The current Spiderwiz version comes with implementation of three communication protocols - TCP/IP sockets, WebSockets and local file
input-output (the latter is used mainly for offline debugging). You can extend the framework by writing your own communication
plugins. For that purpose, we provide two base classes that you can extend. Channel
is the base
class for a communication channel (like a TCP/IP socket, or a WebSocket session).
ServerChannel
is the base class for implementations of server endpoints, which accept
session requests from clients and establish appropriate channels.
The framework also provides means for importing data from and exporting it to general services that are outside of the framework.
ImportHandler
is used for that purpose. Its default implementation reads general
text lines from the specified communication channel and passes it over to data objects for parsing and handling, as well as
writing text lines generated by the objects to the specified channel. You can extend this class to provide a custom import/export
mechanism.
-
Class Summary Class Description CatchAllFilter<T extends DataObject> An implementation ofFilter
that catches all data objects of a specific type.Channel A base class for classes that handle data communication.DataObject A base class for all Data Objects.Filter<T extends DataObject> A base class for implementing Data Object Filters.ImportHandler This class provides a mechanism for importing data from external resources into the framework and exporting data from the framework to external resources.Main Starting point for all Spiderwiz applications.Main.ObjectCodes Object codes of predefined Data Objects.QueryObject A base class for Query Objects.Resetter Data Object Resetting is the operation that takes place when a consumer of a specific data object type detects loss of data.ServerChannel This is a base class for implementations of server channels.