Inline....

On 16 December 2011 12:24, Ashutosh Singh <[email protected]> wrote:
>
> Hi,
>
> I am trying to do that. here is my code.
>
> ///////////////////////Service Class/////////////
>
> public class Server  implements Hello{
>
>    private  LookupDiscoveryManager ldm = null;
>
>
>    public Server() throws IOException{
>        init();
>    }
>
>
>    @Override
>    public String sayHello() {
>        // TODO Auto-generated method stub
>        return "Hello World";
>
>    }
>
>    public void init() throws IOException{
>        System.out.println("in server main");
>        Exporter myExporter = new 
> BasicJeriExporter(TcpServerEndpoint.getInstance(0), new BasicILFactory());
>
>        // Create a service id as required by the join Manager
>        Uuid myuuid = UuidFactory.generate();
>        ServiceID myService = new ServiceID(myuuid.getMostSignificantBits(), 
> myuuid.getLeastSignificantBits());
>
>        //Create the object proxy for use by joiinmanager
>        Server myProxy = (Server) myExporter.export(this);
>
>        //find the reggie instances
>        LookupLocator[] myLocator = new LookupLocator[]{new 
> LookupLocator("jini://localhost:8080")};
>
>        ldm = new LookupDiscoveryManager(DiscoveryGroupManagement.ALL_GROUPS, 
> myLocator,null  );
>
>        //Now join them
>    }
>
>    public static void main(String[] args) throws IOException {
>    }
>
> }
>
> /************** *****************/
>
> Now as the Join Manager takes 4 arguments and since I am not using a config 
> file .

I'm a little confused as the API docs here: http://river.apache.org/doc/api/

Show no constructor that takes only 4 arguments. Did you really mean
JoinManager?

>  How can  I provide  entry attr sets . From the documentation I found that
>
> "attrSets - array of Entry consisting of the
>                     attribute sets with which to register the service"
>
> But with Entry Interface i don't know what to write.
> Please tell what will go in an entry?
>

You would typically include the "standard" attributes such as:

net.jini.lookup.entry.ServiceInfo

More on that is here in the specifications:

http://river.apache.org/doc/specs/html/schema-spec.html#31204

> Also can I provide the config argument of JoinManager as null?

Given the above re: constructors can you please point me at the
constructor you're using? JoinManager has at least one constructor:

JoinManager(Object serviceProxy, Entry[] attrSets, ServiceID
serviceID, DiscoveryManagement discoveryMgr, LeaseRenewalManager
leaseMgr)

That doesn't take a configuration file. Perhaps you meant
LookupDiscoveryManager? Again:

LookupDiscoveryManager(String[] groups, LookupLocator[] locators,
DiscoveryListener listener)

That has a constructor that doesn't require  a configuration file.


>
> Regards
> Ashutosh Singh
>
>
>> Date: Thu, 15 Dec 2011 13:00:22 +0000
>> Subject: Re: what should be written in a config file for service application?
>> From: [email protected]
>> To: [email protected]
>>
>> Okay so then you don't need to put anything in a configuration file.
>> You can hard-code the lot and then come back and do configuration
>> later as it makes sense.
>>
>> Probably the simplest you can go is to use lookuplocators to find the
>> lookup service and register/lookup.
>>
>> On 15 December 2011 12:54, Ashutosh Singh <[email protected]> wrote:
>> >
>> > The  hello example given contains a complicated server with all the smart 
>> > proxies and different methods of exporting.
>> >
>> > So I am just writing a very basic Hello World application that uses a jeri 
>> > protocol. No SDM's!.
>> >
>> >
>> >
>> >
>> >
>> >> Date: Thu, 15 Dec 2011 12:47:58 +0000
>> >> Subject: Re: what should be written in a config file for service 
>> >> application?
>> >> From: [email protected]
>> >> To: [email protected]
>> >>
>> >> Are you configuring one of the standard services, one of your own or
>> >> one of the examples?
>> >>
>> >> On 15 December 2011 11:36, Ashutosh Singh <[email protected]> wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > I am a novice RIVER user?
>> >> >
>> >> > Can you please tell me what should be written in a config file for a 
>> >> > service application?
>> >> >
>> >> > Regards
>> >> > Ashutosh Singh
>> >> >
>> >
>

Reply via email to