I assume that you want to create a TCP socket factory that will do something
special with connection management? Can you describe what you need the factory
to do?
Practically, expanding the constructor arguments is something to always consider
carefully. Adding a Configuration argument would allow the obvious construction
technique shown below.
net.jini.core.discovery.LookLocator {
socketFactory = new MySocketFactory();
}
org.my.something.Service {
locators = new LookupLocator[] {
new LookupLocator("jini://my.first.host",this);
};
}
The problem is that if a factory is required for one instance, and not another,
how do you convey this so that things can work correctly?
Gregg Wonderly
Sim IJskes - QCG wrote:
Sorry, i disagree,
A SSLEndpoint starts it life also as a constructor without a config
object. A LookupLocator is an entity of the same pattern.
Gr. Sim
Patrick Wright wrote:
No, the standard approach would be that the LookupLocator constructor
would take a Configuration object, and the specification/API would
specify which keys would be read from the configuration to configure
the locator. See the APIs for net.jini.discovery.LookupDiscovery, for
example.
Yes, but in order to configure a LookupLocator, you need a
constructor to
specifiy in the config file.
like
a.b.c {
socketFactory = new MySocketFactory();
lookupLocator = new LookupLocator("jini://d", socketFactory );
}
instead of (without)
a.b.c {
lookupLocator = new LookupLocator("jini://d" );
}
Gr. Sim
--
QCG, Software voor het MKB, 071-5890970, http://www.qcg.nl
Quality Consultancy Group b.v., Leiderdorp, Kvk Leiden: 28088397