The basic idea of this project is
to embed an Economy mechanism
into the Jini system.
This Project is based on the following
basic rules/goals:
1) System/Environment:
2) Mechanism properties:
The basic goals regarding the system design are as follows:
All additional components were put in a new package (called
net.jini.economy) which
is embedded inside the Jini packages. More
details regarding the package.
The System behaves as follows:
graphical explanation
Market Algorithms:
Market Algorithms (or mechanisms)
can be easily added or adapted.
The Market operation is as follows:
Legal Commitments and Obligations
We shall try to describe all kind of commitments and obligations
of the involved entities
(or should we say involved players).
First, the LookUp service, which acts as the market mechanism
core, must be
trustable and accepted by
all sides. This is the most important issue since without this basic
idea the whole model is unacceptable.
The Commitments of the Seller (the Service Provider) are:
We would like to examine and analyze the System on both
mechanisms: Best Quote and VCG.
The overall goal is to determine the cases and scenarios
which implies Incentive Compatibility from
the Seller side.
Furthermore, we would like find the assumptions, regarding
the function "getParams" of the BuyerValuation,
that implies best profit to the buyer and incentive compatibility
for the seller.
There are 4 sub classes (scenarios) that can be considered in a theoretical analysis:
This package contains all the additional
Classes/Interfaces which are necessary
to invoke the On-line market and
use it correctly.
There are 3 basic classes that
construct the foundation of the system:
1) SellerContract
- a new attribute for JINI services. Acts as a contract that the Service
is
committed to.
This abstract class contains:
2) BuyerValuation
- An Interface which defines the Client valuation of a specific Service
Contract.
The Interface
include two functions:
3) Buyer
Parameters - A class that contains the Buyer
parameters that should be visible
to the seller.
This class is constructed by the LookUp service on-line from the
BuyerValuation
instance.
Furthermore, the package contains an Interface, called
EconomyServiceInterface,
that a service must
implement in order to participate
in this new market. The Interface allows the LookUp service to announce
the seller whenever a Final Contract
is constructed and the deal is sealed.
Remark: All other Contract/Valuation
Classes should extends or implements the basic Contract/Valuation.
We should notice that for every
new Contract (or new contract parameters) there should
be a new (or revised) Valuation
class that can evaluate it (knows how to evaluate each parameter).
Moreover, in order to create a
new Contract and Valuation classes You should create a
BuyerParameters class which will
contain all the parameters that can be set by the Buyer.
These Parameters should be considered
inside the quote method (contract class) and should
be retrieved from the getParams
method (Valuation class).
How to invoke an Economy LookUp service
The Invocation of an Economy LookUp Service is very similar
to inocation of a
"regular" one.
Instead of the old command line:
"CreateLookup codebase policyfile dbdir [group,...] [javaprog]
[javaoptions]"
there is another parameter called algorithmtype that
should be set to "FirstQuote" or "SecondQuote"
according to the required Mechanism.
The new command line is:
"CreateLookup codebase policyfile dbdir algorithmtype
[group,...] [javaprog] [javaoptions]"
For example: for a VCG mechanism type:
CreateLookup http://hostname:8080/reggie-dl.jar policyfile
reggie_log VCG public
Instructions for Services to join the Market
Services that would like to join this On-line Market should perform the following:
Instructions for Clients to use the Market
Clients that wish to perform an "Economy lookup" should
connect to LookUp Service which
contains the com.sun.jini.reggie.EconomyRegistrarProxy.
Instead of the old Interface "net.jini.core.lookup.ServiceRegistrar"
the Client should use the new
Interface called "net.jini.core.lookup.EconomyServiceRegistrar",
which defines a new lookup method.
The method is called lookup(ServiceTemplate,BuyerValuation).
In order to use this mechanism,
the Client should create a Valuation class that implements the BuyerValuation
interface. This class can be one
of the classes inside the net.jini.economy package.
The testing environment consists of Java source
files and Perl script files. The clients and services are classes
written in Java. The script that invokes the services and clients with
configurable parameters is written in Perl.
These files are not a part of the MAJIC system and were
written only to test the system.
For the activation of the system you have to run a Web-server, Rmi deamon, and the Lookup server. Batch files that invoke all these programs exist at JINI/testing_environment. You can choose to run the system with the original JINI lookup (normal\invoke.bat), or with the MAJIC market lookup. When you run the MAJIC system, you can choose with which algorithm the lookup will work: First quote (economy\invokef.bat), Second quote (economy\invokes.bat).
Services:
The class service/GenericEconomyServer
is a basic service that performs the generic actions of a service that
connects to MAJIC's economy lookup. A service that wants to connect to
the MAJIC system can be derived from this abstract class (for simpler coding).
In the derived class the new service class can have specfic attributes
and methods. The most important abstract method that the sub-class should
implement is executeServiceImpl which is the method that activates the
actual service for the clients.
2 services have been implemented so far:
SimpleService
-
a service which has only one attribute - price.
PrinterService
-
a more complicated service which has few attributes such as: quality, speed,
price per page, etc.
Clients:
The class service/GenericEconomyServer
is a basic service that performs all the generic actions of a client that
wants to get services from the MAJIC system.
A service that wants to connect to the MAJIC system should
be derived from this abstract class.
2 clients have been implemented so far:
SimpleClient
- a client which has a constant valuation.
PrinterClient
- a client which has a number of attributes, e.g. quality_factor and number_of_pages.
Invocation script:
The services are invoked by the Perl script: JINI/testing_environment/run_test.plx
(all the directories below are in the directory JINI/testing_environment).
This script reads a configuration file from the 'config'
directory, with the following format:
The first line should begin with the string "lookup"
(despite it is not in use - the lookup service is invoked externally).
A line that begins with "#" is a comment line.
A line the begins with the string "service" indicates
that the invoker will invoke services with the parameters from this line,
with the format:
service <service-name> <number_of_identical_services_to_be_invoked> <lookup_host> <host> <delay> <lease_duration> <number_of_contracts_allowed> <price> <quality_factor>A line the begins with the string "client" indicates that the invoker will invoke clients with the parameters from this line, with the format:
client SimpleClient <number_of_identical_clients_to_be_invoked> <lookup_host> <host> <delay_between_executions> <price>The scripts can run either on Unix machines or NT. The execution line must be:
perl run_test.plx <config_file_name> <test_number> <host_name>The script will run only the services and clients that their host (in the configuration line) is equal to the "host_name" given in the execution line. The log files will be written on the directory: log_files/<config_file_name>/<test_number>.
We have performed the tests of the MAJIC system in the
following way: the services were invoked on the NT, and the (many) clients
were invoked on linux machines (inferno), and the Web-server, RMI deamon
and lookup run on NT.
Invoking more than few clients on the Windows/NT can
cause problems (such as memory overuse).
The following modifications and additions were made in
the Jini system for the MAJIC system:
1. A new package was added: net.jini.economy
. The package contains the basic components of the MAJIC infrastructure.
2. Classes added to net.jini.core.lookup are: EconomyServiceMatch
,
EconomyServiceRegistrar
3. Classes added to com.sun.jini.reggie are: EconomyRegistrar,
EconomyRegistrarImpl,
EconomyRegistrarProxy, DealWrapper,FinalContractLeaseImpl.
Modified classes in com.sun.jini.reggie are: CreateLookup.
The EconomyRegistrarImpl class holds the implementation
of the MAJIC's economy market mechanism. The market algorithm (i.e. first
quote and second quote) are implemented in it.
last updated: 25.9.2000