You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Filip Defoort <fi...@cirquedigital.com> on 2003/10/22 01:36:30 UTC

merlin swing apps

Hi,

Does anybody have any thoughts on pros and cons of building swing 
applications
with merlin? I have a rather large swing app running in Fortress right 
now, and
that's all running as expected.

Now, I'm splitting the app into a server component and a
client component iso a pure client side app. It's be nice to be able to 
use the same
technology for the client and the server side, so I can easily move 
components from
one side to the other as required. It'd also be great to be able to 
auto-download
updates from a central server and things like that. Seems like Merlin is 
especially
apt at all that. However, Merlin seems to be more targeted at server 
applications,
so I'm wondering what would be required to let Merlin run a swing app 
(some hooks
during startup, being able to trap runtime exceptions and at the very 
least display
them to the users, event bus,...)

Anybody any observations?

Thanks a lot,
- Filip



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Filip Defoort <fi...@cirquedigital.com>.
Stephen McConnell wrote:

>
> <snip/>
>
>>
>>
>> Actually, I was thinking about a single JVM: merlin would start up 
>> via a service and load most
>> of the "operating system services" it needs; when the user actually 
>> wants to interact with the
>> application, a second container would launch in the same JVM and pop 
>> up a gui for
>> user interaction... (afraid that running in two separate JVMs and 
>> remoting all calls between
>> gui and back-end is going to make the app too slow; but starting 
>> everything at once makes
>> the startup rather slow...). Not feasible? 
>
>
>
> OK - I now understood your objective.
>
> One question ....
>
> Are you thinking "component browser" (outside looking in) or componet 
> panels (inside looking out). 

Don't completely understand the question, basically I'm dealing with an 
asset
structure (strongly typed hierarchy of "stuff"); I have a number of 
navigator
components (tree,...) and a set of contextualizable panels for each item 
in the
hierarchy (e.g. email panel with all mails that have to do with a 
specific panel);
the idea is that the backend stuff gets loaded once; the physical user then
requests to perform some operations with the assets, he would basically 
specify
the name of an app that he wants, this app is a component that would be 
started,
that component then goes and finds the appropriate navigators, item 
panels,...
and lays all that out for the user to interact with. When user is done, 
all the components
that have to do with the gui interaction get disposed().

Seems to go more inside looking out... Let me know if my answer is off 
course...

Thanks,
- Filip

>
>
> Stephen.
>
>
>
>
>
>
>>
>>
>> - Filip
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>> For additional commands, e-mail: dev-help@avalon.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Stephen McConnell <mc...@apache.org>.

Filip Defoort wrote:

> Stephen McConnell wrote:
>
>>
>>
>> Filip Defoort wrote:
>>
>>> Stephen McConnell wrote:
>>>
>>>> Filip Defoort wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Does anybody have any thoughts on pros and cons of building swing 
>>>>> applications
>>>>> with merlin? I have a rather large swing app running in Fortress 
>>>>> right now, and
>>>>> that's all running as expected.
>>>>> ....
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I would take something like kernel/unit package as an example and 
>>>> retro fit to handle the swing context (using a variant of 
>>>> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
>>>> errors, exceptions, etc.  I figure some of this will be changing 
>>>> but the changes will be based on experience gained in different 
>>>> embedded scenarios - and a swing scenario is more input.
>>>> Cheers, Steve. 
>>>
>>>
>>>
>>>
>>> That looks easy enough indeed. I could even simply add some things 
>>> in Merlin.java: basically all
>>> I need is some sort of splash screen (I'm using a BroadcastLogger 
>>> that displays info messages
>>> into it while starting up) and then get to the kernel exceptions and 
>>> display them -- the actual
>>> gui is simply a component and can easily be started..
>>>
>>> Thinking further on that: as an intermediate step between completely 
>>> splitting my stuff in server <-> client,
>>> is it possible to dynamically load and unload containers into an 
>>> already running Merlin kernel ?
>>> That way I could use merlin as an NT service and load all the stuff 
>>> that takes a while to load,
>>> but when the user loads the gui, simply contact the NT service and 
>>> drop the gui container in the
>>> kernel, which would come up nice and fast and have access to all the 
>>> services of the container...
>>> Is this possible ?? 
>>
>>
>>
>>
>> What your describing is a seperation of services across two JVMs.  
>> That means you would need a remoting layer (RMI, AltRMI, IIOP, 
>> whatever).  There are plans to add container listeners so that we 
>> would be able to provide automatic service export in the future. In 
>> the meantime Aaron has done some stuff related to this in the 
>> sandbox/exporter package - an extension that provides AltRMI 
>> accessible services.
>>
>> Stephen. 
>
>
> Actually, I was thinking about a single JVM: merlin would start up via 
> a service and load most
> of the "operating system services" it needs; when the user actually 
> wants to interact with the
> application, a second container would launch in the same JVM and pop 
> up a gui for
> user interaction... (afraid that running in two separate JVMs and 
> remoting all calls between
> gui and back-end is going to make the app too slow; but starting 
> everything at once makes
> the startup rather slow...). Not feasible? 


OK - I now understood your objective.

One question ....

Are you thinking "component browser" (outside looking in) or componet 
panels (inside looking out).

Stephen.






>
>
> - Filip
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org
>
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Filip Defoort <fi...@cirquedigital.com>.
Stephen McConnell wrote:

>
>
> Filip Defoort wrote:
>
>> Stephen McConnell wrote:
>>
>>> Filip Defoort wrote:
>>>
>>>> Hi,
>>>>
>>>> Does anybody have any thoughts on pros and cons of building swing 
>>>> applications
>>>> with merlin? I have a rather large swing app running in Fortress 
>>>> right now, and
>>>> that's all running as expected.
>>>> ....
>>>
>>>
>>>
>>>
>>> I would take something like kernel/unit package as an example and 
>>> retro fit to handle the swing context (using a variant of 
>>> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
>>> errors, exceptions, etc.  I figure some of this will be changing but 
>>> the changes will be based on experience gained in different embedded 
>>> scenarios - and a swing scenario is more input.
>>> Cheers, Steve. 
>>
>>
>>
>> That looks easy enough indeed. I could even simply add some things in 
>> Merlin.java: basically all
>> I need is some sort of splash screen (I'm using a BroadcastLogger 
>> that displays info messages
>> into it while starting up) and then get to the kernel exceptions and 
>> display them -- the actual
>> gui is simply a component and can easily be started..
>>
>> Thinking further on that: as an intermediate step between completely 
>> splitting my stuff in server <-> client,
>> is it possible to dynamically load and unload containers into an 
>> already running Merlin kernel ?
>> That way I could use merlin as an NT service and load all the stuff 
>> that takes a while to load,
>> but when the user loads the gui, simply contact the NT service and 
>> drop the gui container in the
>> kernel, which would come up nice and fast and have access to all the 
>> services of the container...
>> Is this possible ?? 
>
>
>
> What your describing is a seperation of services across two JVMs.  
> That means you would need a remoting layer (RMI, AltRMI, IIOP, 
> whatever).  There are plans to add container listeners so that we 
> would be able to provide automatic service export in the future. In 
> the meantime Aaron has done some stuff related to this in the 
> sandbox/exporter package - an extension that provides AltRMI 
> accessible services.
>
> Stephen. 

Actually, I was thinking about a single JVM: merlin would start up via a 
service and load most
of the "operating system services" it needs; when the user actually 
wants to interact with the
application, a second container would launch in the same JVM and pop up 
a gui for
user interaction... (afraid that running in two separate JVMs and 
remoting all calls between
gui and back-end is going to make the app too slow; but starting 
everything at once makes
the startup rather slow...). Not feasible?

- Filip


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Stephen McConnell <mc...@apache.org>.

Filip Defoort wrote:

> Stephen McConnell wrote:
>
>> Filip Defoort wrote:
>>
>>> Hi,
>>>
>>> Does anybody have any thoughts on pros and cons of building swing 
>>> applications
>>> with merlin? I have a rather large swing app running in Fortress 
>>> right now, and
>>> that's all running as expected.
>>> ....
>>
>>
>>
>> I would take something like kernel/unit package as an example and 
>> retro fit to handle the swing context (using a variant of 
>> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
>> errors, exceptions, etc.  I figure some of this will be changing but 
>> the changes will be based on experience gained in different embedded 
>> scenarios - and a swing scenario is more input.
>> Cheers, Steve. 
>
>
> That looks easy enough indeed. I could even simply add some things in 
> Merlin.java: basically all
> I need is some sort of splash screen (I'm using a BroadcastLogger that 
> displays info messages
> into it while starting up) and then get to the kernel exceptions and 
> display them -- the actual
> gui is simply a component and can easily be started..
>
> Thinking further on that: as an intermediate step between completely 
> splitting my stuff in server <-> client,
> is it possible to dynamically load and unload containers into an 
> already running Merlin kernel ?
> That way I could use merlin as an NT service and load all the stuff 
> that takes a while to load,
> but when the user loads the gui, simply contact the NT service and 
> drop the gui container in the
> kernel, which would come up nice and fast and have access to all the 
> services of the container...
> Is this possible ?? 


What your describing is a seperation of services across two JVMs.  That 
means you would need a remoting layer (RMI, AltRMI, IIOP, whatever).  
There are plans to add container listeners so that we would be able to 
provide automatic service export in the future. In the meantime Aaron 
has done some stuff related to this in the sandbox/exporter package - an 
extension that provides AltRMI accessible services.

Stephen.

>
>
> Thanks for the input so far!
> - Filip
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org
>
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Filip Defoort <fi...@cirquedigital.com>.
Berin Loritsch wrote:

>
> Now, I have a GUIApp Swing Framework built on Fortress.  It could easily
> be ported to Merlin as far as I know.  Anyhoo, I'm always open to 
> suggestions
> with what will make it better.
>
yes, I remember that.. When checking out some of the latest sources, I 
found some
code that was merlin related in there -- could you tell me the state of 
that code?

Difference with GUIApp is that my gui is not your regular toplevel 
window with
toolbar and a set of commands. I need to set up the relationships 
between some
navigator panels and then panels that operate within a given context. 
Really liked
the event bus and things like that; but don't necessarily need to be 
able to start
the gui from a single script.

- Filip


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Berin Loritsch <bl...@apache.org>.
Filip Defoort wrote:

> Stephen McConnell wrote:
> 
>> Filip Defoort wrote:
>>
>>> Hi,
>>>
>>> Does anybody have any thoughts on pros and cons of building swing 
>>> applications
>>> with merlin? I have a rather large swing app running in Fortress 
>>> right now, and
>>> that's all running as expected.
>>> ....
>>
>>
>>
>> I would take something like kernel/unit package as an example and 
>> retro fit to handle the swing context (using a variant of 
>> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
>> errors, exceptions, etc.  I figure some of this will be changing but 
>> the changes will be based on experience gained in different embedded 
>> scenarios - and a swing scenario is more input.
>> Cheers, Steve. 
> 
> 
> That looks easy enough indeed. I could even simply add some things in 
> Merlin.java: basically all
> I need is some sort of splash screen (I'm using a BroadcastLogger that 
> displays info messages
> into it while starting up) and then get to the kernel exceptions and 
> display them -- the actual
> gui is simply a component and can easily be started..

Now, I have a GUIApp Swing Framework built on Fortress.  It could easily
be ported to Merlin as far as I know.  Anyhoo, I'm always open to suggestions
with what will make it better.


> 
> Thinking further on that: as an intermediate step between completely 
> splitting my stuff in server <-> client,
> is it possible to dynamically load and unload containers into an already 
> running Merlin kernel ?
> That way I could use merlin as an NT service and load all the stuff that 
> takes a while to load,
> but when the user loads the gui, simply contact the NT service and drop 
> the gui container in the
> kernel, which would come up nice and fast and have access to all the 
> services of the container...
> Is this possible ??
> 
> Thanks for the input so far!
> - Filip
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org
> 
> 
> 


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Filip Defoort <fi...@cirquedigital.com>.
Stephen McConnell wrote:

> Filip Defoort wrote:
>
>> Hi,
>>
>> Does anybody have any thoughts on pros and cons of building swing 
>> applications
>> with merlin? I have a rather large swing app running in Fortress 
>> right now, and
>> that's all running as expected.
>> ....
>
>
> I would take something like kernel/unit package as an example and 
> retro fit to handle the swing context (using a variant of 
> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
> errors, exceptions, etc.  I figure some of this will be changing but 
> the changes will be based on experience gained in different embedded 
> scenarios - and a swing scenario is more input.
> Cheers, Steve. 

That looks easy enough indeed. I could even simply add some things in 
Merlin.java: basically all
I need is some sort of splash screen (I'm using a BroadcastLogger that 
displays info messages
into it while starting up) and then get to the kernel exceptions and 
display them -- the actual
gui is simply a component and can easily be started..

Thinking further on that: as an intermediate step between completely 
splitting my stuff in server <-> client,
is it possible to dynamically load and unload containers into an already 
running Merlin kernel ?
That way I could use merlin as an NT service and load all the stuff that 
takes a while to load,
but when the user loads the gui, simply contact the NT service and drop 
the gui container in the
kernel, which would come up nice and fast and have access to all the 
services of the container...
Is this possible ??

Thanks for the input so far!
- Filip





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Filip Defoort <fi...@cirquedigital.com>.
Stephen McConnell wrote:

>
> <snip/>
>
> I would take something like kernel/unit package as an example and 
> retro fit to handle the swing context (using a variant of 
> DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
> errors, exceptions, etc.  I figure some of this will be changing but 
> the changes will be based on experience gained in different embedded 
> scenarios - and a swing scenario is more input.
> Cheers, Steve. 


Another related question: suppose I bootstrap my container and one of 
the components is actually
the swing application; how do I shut the kernel down when the user kills 
the swing app?

I can see a couple of different approaches:
1/ components are allowed to shutdown the kernel. Obviously there are 
"issues" with
this approach..
2/ let the bootstrapper make the main window and on windowClose() do 
kernel.shutdown();
and put the reference to the main window in the Context(); the actual 
components then can put stuff inside of the
main window, but cannot create other "root" windows...  Also has some 
problems in cases
where you want multiple top windows or different windows based on 
configuration settings
(e.g. my app runs in standalone and in plugin mode: standalone uses a 
JFrame, plugin mode
uses a JDialog and a slightly different gui -- it'd be nice to simply 
make this difference in
a config file).
3/ Put a RootWindowFactory in the Context -- instead of components doing 
a new JFrame,
they do a service.lookup("window-factory") and do 
WindowFactory.createJFrame();
the instance that gets created already has the windowClose() handler 
atl. set up.  Looks most
appealing to me for the moment... Also not 100% secure though..

All this obviously in the case of starting a merlin session for the gui 
app, not in the case of
deploying a "gui container" in an already running merlin. Which would 
still be the niftiest
solution. Actually this will have a similar 'problem': in that case I 
would need a way to
dispose of the container that created the window (as opposed to getting 
rid of the entire
kernel).

any preferences and/or gotcha's ?

Thanks a lot,
- Filip

>
>
>>
>>
>> Thanks a lot,
>> - Filip
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>> For additional commands, e-mail: dev-help@avalon.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: merlin swing apps

Posted by Stephen McConnell <mc...@apache.org>.

Filip Defoort wrote:

> Hi,
>
> Does anybody have any thoughts on pros and cons of building swing 
> applications
> with merlin? I have a rather large swing app running in Fortress right 
> now, and
> that's all running as expected.
>
> Now, I'm splitting the app into a server component and a
> client component iso a pure client side app. It's be nice to be able 
> to use the same
> technology for the client and the server side, so I can easily move 
> components from
> one side to the other as required. It'd also be great to be able to 
> auto-download
> updates from a central server and things like that. Seems like Merlin 
> is especially
> apt at all that. However, Merlin seems to be more targeted at server 
> applications,
> so I'm wondering what would be required to let Merlin run a swing app 
> (some hooks
> during startup, being able to trap runtime exceptions and at the very 
> least display
> them to the users, event bus,...)
>
> Anybody any observations? 


I would take something like kernel/unit package as an example and retro 
fit to handle the swing context (using a variant of 
DefaultEmbeddedKernel as Alex suggested).  This will let you handle 
errors, exceptions, etc.  I figure some of this will be changing but the 
changes will be based on experience gained in different embedded 
scenarios - and a swing scenario is more input. 

Cheers, Steve.

>
>
> Thanks a lot,
> - Filip
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> For additional commands, e-mail: dev-help@avalon.apache.org
>
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org