very stupid question about lookup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

very stupid question about lookup

Peter Cheung
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Benno Markiewicz
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Peter Cheung

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz <[hidden email]>
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Geertjan Wielenga-3

https://platform.netbeans.org/tutorials/nbm-quick-start.html

Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Peter Cheung

Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?

thanks

from Peter




From: geertjan wielenga <[hidden email]>
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 

https://platform.netbeans.org/tutorials/nbm-quick-start.html
platform.netbeans.org
NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.



Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Geertjan Wielenga-3


Why would it not be in the same module suite?

Anyway, please follow that tutorial and apply it to your use case.

Gj

On 3-1-2017 17:52, Peter Cheung wrote:

Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?

thanks

from Peter




From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 

https://platform.netbeans.org/tutorials/nbm-quick-start.html
platform.netbeans.org
NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.



Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Peter Cheung

I followed the tutorial, it works. But i got two independent projects, they want to lookup each other, thats why they are not in the same module suite. Any hints?




From: geertjan wielenga <[hidden email]>
Sent: Wednesday, January 4, 2017 12:55 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 


Why would it not be in the same module suite?

Anyway, please follow that tutorial and apply it to your use case.

Gj

On 3-1-2017 17:52, Peter Cheung wrote:

Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?

thanks

from Peter




From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 

https://platform.netbeans.org/tutorials/nbm-quick-start.html
platform.netbeans.org
NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.



Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Geertjan Wielenga-3


No, that doesn't make sense. Different applications can't communicate with each other via Lookup, that's not what it's for.

Gj

On 3-1-2017 18:12, Peter Cheung wrote:

I followed the tutorial, it works. But i got two independent projects, they want to lookup each other, thats why they are not in the same module suite. Any hints?




From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:55 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 


Why would it not be in the same module suite?

Anyway, please follow that tutorial and apply it to your use case.

Gj

On 3-1-2017 17:52, Peter Cheung wrote:

Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?

thanks

from Peter




From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 

https://platform.netbeans.org/tutorials/nbm-quick-start.html
platform.netbeans.org
NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.



Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks




From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

wadechandler
Administrator
In reply to this post by Peter Cheung
Are you trying to use these as “remote” services or through some other IPC mechanism, or do you just mean you have independent projects, which happen to build some libraries, and you want to use libraries across the projects? A few more details about what you are doing may help.

I have in the past created platforms as module suites, and then applications used those as various sets of dependencies. Both were “module suites”, and I have used those across projects. The output of that is a cluster. I was using Maven for that. You need to include a dependency on your module suite from your suite or application, similar to the way there is a dep for the NB suite, and then the individual modules will have deps on the individual modules.

I will see about some Maven specific tutorial on that perhaps, but maybe this can help some along with its reference links:
http://wiki.netbeans.org/DevFaqWhatIsACluster


===================

Wade Chandler



On Jan 3, 2017, at 12:12, Peter Cheung <[hidden email]> wrote:

I followed the tutorial, it works. But i got two independent projects, they want to lookup each other, thats why they are not in the same module suite. Any hints?



From: geertjan wielenga <[hidden email]>
Sent: Wednesday, January 4, 2017 12:55 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 


Why would it not be in the same module suite?

Anyway, please follow that tutorial and apply it to your use case.

Gj

On 3-1-2017 17:52, Peter Cheung wrote:
Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?
thanks
from Peter



From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup
 

https://platform.netbeans.org/tutorials/nbm-quick-start.html
NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.



Gj

On 3-1-2017 17:04, Peter Cheung wrote:
What is API module? any tutorial of that?
thanks



From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup
 
How about an API-module? 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:
Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter


====================
Wade Chandler

Software Engineer
NetBeans and Open Source Contributor
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: very stupid question about lookup

Marini, Joseph - 1004 - MITLL

This could be another approach.

To comment on the idea of module suites, you could actually build a plugin of those two modules.

Then added that plugin to both applications. (code reuse)

I assume you are building RCP applications.

Now you can use lookup to find the modules or service you are looking for in each application.

 

Creating a plugin in Netbeans is pretty easy.

 

 

/Joe

 

From: Wade Chandler [mailto:[hidden email]] On Behalf Of Wade Chandler
Sent: Tuesday, January 03, 2017 2:05 PM
To: Platform Mailing List
Subject: [platform-dev] Re: very stupid question about lookup

 

Are you trying to use these as “remote” services or through some other IPC mechanism, or do you just mean you have independent projects, which happen to build some libraries, and you want to use libraries across the projects? A few more details about what you are doing may help.

 

I have in the past created platforms as module suites, and then applications used those as various sets of dependencies. Both were “module suites”, and I have used those across projects. The output of that is a cluster. I was using Maven for that. You need to include a dependency on your module suite from your suite or application, similar to the way there is a dep for the NB suite, and then the individual modules will have deps on the individual modules.

 

I will see about some Maven specific tutorial on that perhaps, but maybe this can help some along with its reference links:

http://wiki.netbeans.org/DevFaqWhatIsACluster

 

===================

 

Wade Chandler

 

 

 

On Jan 3, 2017, at 12:12, Peter Cheung <[hidden email]> wrote:

 

I followed the tutorial, it works. But i got two independent projects, they want to lookup each other, thats why they are not in the same module suite. Any hints?

 


From: geertjan wielenga <[hidden email]>
Sent: Wednesday, January 4, 2017 12:55 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup

 



Why would it not be in the same module suite?

Anyway, please follow that tutorial and apply it to your use case.

Gj

On 3-1-2017 17:52, Peter Cheung wrote:

Thanks, your link is working. But why i can only find my api-module in the same module suite? If the module is not in the same module suite, i can't find it in "module dependencies"?

thanks

from Peter

 


From: geertjan wielenga [hidden email]
Sent: Wednesday, January 4, 2017 12:07 AM
To: [hidden email]
Subject: [platform-dev] Re: very stupid question about lookup

 


https://platform.netbeans.org/tutorials/nbm-quick-start.html

NetBeans Platform Quick Start. Welcome to the NetBeans Platform! The NetBeans Platform is a generic application framework primarily for Java desktop applications.




Gj

On 3-1-2017 17:04, Peter Cheung wrote:

What is API module? any tutorial of that?

thanks

 


From: Benno Markiewicz [hidden email]
Sent: Tuesday, January 3, 2017 10:13 PM
To: dev
Subject: [platform-dev] Re: very stupid question about lookup

 

How about an API-module? 

 

Den 3 jan. 2017 2:36 em skrev "Peter Cheung" <[hidden email]>:

Hi
   I have implemented my own server in a module, in another module i am ok to lookup its instance by :

                for (MainService s : Lookup.getDefault().lookupAll(MainService.class)) {
                        ModuleLib.log(s + " = " + s.peter());
                }

But i need to include module A in module B. That is not right i thing, because when i did that, the toolbar button (i meant the actions) from module A will crash when i install module B. Another big question is : how about they both need to lookup each other, do that need to include each other?

thanks
from Peter

 


smime.p7s (7K) Download Attachment
Loading...