Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Close Workbench
Close Workbench [message #24729] Wed, 16 May 2007 11:37 Go to next message
Roberto Sanchez is currently offline Roberto SanchezFriend
Messages: 82
Registered: July 2009
Member
Hello all,

What is the best way to close the application ? or dispose http session ?

I'm tryed with: "PlatformUI.getWorkbench().close();", but It isn't
implemented yet, Is there any alternatives/workarround ?

Thanks in advance.
Roberto.
Re: Close Workbench [message #25268 is a reply to message #24729] Thu, 17 May 2007 16:56 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 335
Registered: July 2009
Senior Member
Hi Roberto,

here is a limited workaround that closes the workbench window and then
reaches down to w4t and attaches a PhaseListener that invalidates the
session after the current request was processed.
Thus You will end up with an empty client document just showing the
background image.

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
W4TContext.getLifeCycle().addPhaseListener( new PhaseListener() {
private static final long serialVersionUID = 1L;

public void beforePhase( final PhaseEvent event ) {
// do nothing
}

public void afterPhase( final PhaseEvent event ) {
W4TContext.getLifeCycle().removePhaseListener( this );
ContextProvider.getSession().invalidate();
}

public PhaseId getPhaseId() {
return PhaseId.RENDER;
}
} );


Hope that helps
Rüdiger


Roberto Sá‡nchez wrote:
> Hello all,
>
> What is the best way to close the application ? or dispose http session ?
>
> I'm tryed with: "PlatformUI.getWorkbench().close();", but It isn't
> implemented yet, Is there any alternatives/workarround ?
>
> Thanks in advance.
> Roberto.
Re: Close Workbench [message #25350 is a reply to message #25268] Thu, 17 May 2007 18:17 Go to previous messageGo to next message
Roberto Sanchez is currently offline Roberto SanchezFriend
Messages: 82
Registered: July 2009
Member
Perfect !! It's exactly what I looking for.

Thank you very much.

Regards.
Roberto.

Ruediger Herrmmann escribió:
> Hi Roberto,
>
> here is a limited workaround that closes the workbench window and then
> reaches down to w4t and attaches a PhaseListener that invalidates the
> session after the current request was processed.
> Thus You will end up with an empty client document just showing the
> background image.
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
> W4TContext.getLifeCycle().addPhaseListener( new PhaseListener() {
> private static final long serialVersionUID = 1L;
>
> public void beforePhase( final PhaseEvent event ) {
> // do nothing
> }
>
> public void afterPhase( final PhaseEvent event ) {
> W4TContext.getLifeCycle().removePhaseListener( this );
> ContextProvider.getSession().invalidate();
> }
>
> public PhaseId getPhaseId() {
> return PhaseId.RENDER;
> }
> } );
>
>
> Hope that helps
> Rüdiger
>
>
> Roberto Sá‡nchez wrote:
>> Hello all,
>>
>> What is the best way to close the application ? or dispose http session ?
>>
>> I'm tryed with: "PlatformUI.getWorkbench().close();", but It isn't
>> implemented yet, Is there any alternatives/workarround ?
>>
>> Thanks in advance.
>> Roberto.
Re: Close Workbench [message #30300 is a reply to message #25268] Fri, 01 June 2007 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: benedikt.arnold.beyondsoft.de

Hi!
If I call
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();

I get the following exception:
01.06.2007 15:45:52 org.mortbay.jetty.servlet.ServletHandler handle

SCHWERWIEGEND:
/rap?nocache=1180705552042&w2.activeControl=w10&org. eclipse.swt.events.widgetSelected=w13&w13.bounds.x=null& amp;w13.bounds.y=null&w13.bounds.width=auto&w13.boun ds.height=null&w1.focusControl=w11&uiRoot=w1&req uestCounter=0:

java.lang.NullPointerException

at
org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchW indow.java:1475)

at
org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:603)

at
org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:579)

at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindo w.java:696)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)

at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindo w.java:694)

at org.eclipse.jface.window.Window.handleShellCloseEvent(Window .java:732)

at org.eclipse.jface.window.Window$3.shellClosed(Window.java:67 8)

at org.eclipse.swt.events.ShellEvent.dispatchToObserver(ShellEv ent.java:39)

at com.w4t.event.Event.processEvent(Event.java:45)

at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)

at org.eclipse.swt.widgets.Shell.close(Shell.java:606)

at
de.beyondsoft.voipconf.web.ui.VoIPConfActionBarAdvisor$1.run (VoIPConfActionBarAdvisor.java:45)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:495 )

at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:526)

at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:471)

at
org.eclipse.jface.action.ActionContributionItem$4.handleEven t(ActionContributionItem.java:424)

at
org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc hEvent(UntypedEventAdapter.java:244)

at
org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS elected(UntypedEventAdapter.java:72)

at
org.eclipse.swt.events.SelectionEvent.dispatchToObserver(Sel ectionEvent.java:116)

at com.w4t.event.Event.processEvent(Event.java:45)

at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)

at org.eclipse.swt.events.TypedEvent.processEventClass(TypedEve nt.java:117)

at
org.eclipse.swt.events.TypedEvent.processScheduledEvents(Typ edEvent.java:57)

at
org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.proce ssAction(DisplayLCA.java:231)

at
org.eclipse.swt.internal.lifecycle.ProcessAction.execute(Pro cessAction.java:27)

at
org.eclipse.swt.internal.lifecycle.RWTLifeCycle.execute(RWTL ifeCycle.java:78)

at com.w4t.engine.W4TModel$ServiceAdapter.execute(W4TModel.java :47)

at
com.w4t.engine.service.FormRequestServiceHandler.service(For mRequestServiceHandler.java:65)

at
com.w4t.engine.service.ServiceManager$HandlerDispatcher.serv ice(ServiceManager.java:104)

at com.w4t.engine.W4TDelegate.doPost(W4TDelegate.java:75)

at
org.eclipse.ui.internal.servlet.RequestHandler.service(Reque stHandler.java:41)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at
org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)

at
org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)

at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:109)

at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:59)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

at
org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:280)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428)

at
org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)

at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)

at org.mortbay.http.HttpServer.service(HttpServer.java:909)

at org.mortbay.http.HttpConnection.service(HttpConnection.java: 820)

at org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986)

at org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37)

at org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245)

at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57)

at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34)

"Ruediger Herrmmann" <ruediger.herrmann@gmx.de> schrieb im Newsbeitrag
news:f2i1h4$k33$1@build.eclipse.org...
> Hi Roberto,
>
> here is a limited workaround that closes the workbench window and then
> reaches down to w4t and attaches a PhaseListener that invalidates the
> session after the current request was processed.
> Thus You will end up with an empty client document just showing the
> background image.
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
> W4TContext.getLifeCycle().addPhaseListener( new PhaseListener() {
> private static final long serialVersionUID = 1L;
>
> public void beforePhase( final PhaseEvent event ) {
> // do nothing
> }
>
> public void afterPhase( final PhaseEvent event ) {
> W4TContext.getLifeCycle().removePhaseListener( this );
> ContextProvider.getSession().invalidate();
> }
>
> public PhaseId getPhaseId() {
> return PhaseId.RENDER;
> }
> } );
>
>
> Hope that helps
> R
Re: Close Workbench [message #30336 is a reply to message #30300] Fri, 01 June 2007 15:22 Go to previous messageGo to next message
Roberto Sanchez is currently offline Roberto SanchezFriend
Messages: 82
Registered: July 2009
Member
Hi Benedikt, now I have the same problem, but when I tryed the first
time this worked fine.

Benedikt Arnold escribió:
> Hi!
> If I call
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
>
> I get the following exception:
> 01.06.2007 15:45:52 org.mortbay.jetty.servlet.ServletHandler handle
>
> SCHWERWIEGEND:
> /rap?nocache=1180705552042&w2.activeControl=w10&org. eclipse.swt.events.widgetSelected=w13&w13.bounds.x=null& amp;w13.bounds.y=null&w13.bounds.width=auto&w13.boun ds.height=null&w1.focusControl=w11&uiRoot=w1&req uestCounter=0:
>
> java.lang.NullPointerException
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchW indow.java:1475)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:603)
>
> at
> org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:579)
>
> at org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindo w.java:696)
>
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>
> at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindo w.java:694)
>
> at org.eclipse.jface.window.Window.handleShellCloseEvent(Window .java:732)
>
> at org.eclipse.jface.window.Window$3.shellClosed(Window.java:67 8)
>
> at org.eclipse.swt.events.ShellEvent.dispatchToObserver(ShellEv ent.java:39)
>
> at com.w4t.event.Event.processEvent(Event.java:45)
>
> at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)
>
> at org.eclipse.swt.widgets.Shell.close(Shell.java:606)
>
> at
> de.beyondsoft.voipconf.web.ui.VoIPConfActionBarAdvisor$1.run (VoIPConfActionBarAdvisor.java:45)
>
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:495 )
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:526)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:471)
>
> at
> org.eclipse.jface.action.ActionContributionItem$4.handleEven t(ActionContributionItem.java:424)
>
> at
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc hEvent(UntypedEventAdapter.java:244)
>
> at
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS elected(UntypedEventAdapter.java:72)
>
> at
> org.eclipse.swt.events.SelectionEvent.dispatchToObserver(Sel ectionEvent.java:116)
>
> at com.w4t.event.Event.processEvent(Event.java:45)
>
> at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)
>
> at org.eclipse.swt.events.TypedEvent.processEventClass(TypedEve nt.java:117)
>
> at
> org.eclipse.swt.events.TypedEvent.processScheduledEvents(Typ edEvent.java:57)
>
> at
> org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.proce ssAction(DisplayLCA.java:231)
>
> at
> org.eclipse.swt.internal.lifecycle.ProcessAction.execute(Pro cessAction.java:27)
>
> at
> org.eclipse.swt.internal.lifecycle.RWTLifeCycle.execute(RWTL ifeCycle.java:78)
>
> at com.w4t.engine.W4TModel$ServiceAdapter.execute(W4TModel.java :47)
>
> at
> com.w4t.engine.service.FormRequestServiceHandler.service(For mRequestServiceHandler.java:65)
>
> at
> com.w4t.engine.service.ServiceManager$HandlerDispatcher.serv ice(ServiceManager.java:104)
>
> at com.w4t.engine.W4TDelegate.doPost(W4TDelegate.java:75)
>
> at
> org.eclipse.ui.internal.servlet.RequestHandler.service(Reque stHandler.java:41)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>
> at
> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
>
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:109)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:59)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:280)
>
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428)
>
> at
> org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677)
>
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568)
>
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>
> at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>
> at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>
> at org.mortbay.http.HttpConnection.service(HttpConnection.java: 820)
>
> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986)
>
> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37)
>
> at org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245)
>
> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57)
>
> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34)
>
> "Ruediger Herrmmann" <ruediger.herrmann@gmx.de> schrieb im Newsbeitrag
> news:f2i1h4$k33$1@build.eclipse.org...
>> Hi Roberto,
>>
>> here is a limited workaround that closes the workbench window and then
>> reaches down to w4t and attaches a PhaseListener that invalidates the
>> session after the current request was processed.
>> Thus You will end up with an empty client document just showing the
>> background image.
>>
>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
>> W4TContext.getLifeCycle().addPhaseListener( new PhaseListener() {
>> private static final long serialVersionUID = 1L;
>>
>> public void beforePhase( final PhaseEvent event ) {
>> // do nothing
>> }
>>
>> public void afterPhase( final PhaseEvent event ) {
>> W4TContext.getLifeCycle().removePhaseListener( this );
>> ContextProvider.getSession().invalidate();
>> }
>>
>> public PhaseId getPhaseId() {
>> return PhaseId.RENDER;
>> }
>> } );
>>
>>
>> Hope that helps
>> Rüdiger
>>
>>
>> Roberto Sá‡nchez wrote:
>>> Hello all,
>>>
>>> What is the best way to close the application ? or dispose http session ?
>>>
>>> I'm tryed with: "PlatformUI.getWorkbench().close();", but It isn't
>>> implemented yet, Is there any alternatives/workarround ?
>>>
>>> Thanks in advance.
>>> Roberto.
>
>
Re: Close Workbench [message #30372 is a reply to message #30336] Fri, 01 June 2007 15:25 Go to previous message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 237
Registered: July 2009
Senior Member
Hi,

this has to do with the switch to the RCP 3.3 codebase. Be patient, I'll
care for this the next days. If you want, just file a bug against the
Workbench component.

Greets
Benny

Roberto Sá‡nchez wrote:
> Hi Benedikt, now I have the same problem, but when I tryed the first
> time this worked fine.
>
> Benedikt Arnold escribió:
>> Hi!
>> If I call
>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
>>
>> I get the following exception:
>> 01.06.2007 15:45:52 org.mortbay.jetty.servlet.ServletHandler handle
>>
>> SCHWERWIEGEND:
>> /rap?nocache=1180705552042&w2.activeControl=w10&org. eclipse.swt.events.widgetSelected=w13&w13.bounds.x=null& amp;w13.bounds.y=null&w13.bounds.width=auto&w13.boun ds.height=null&w1.focusControl=w11&uiRoot=w1&req uestCounter=0:
>>
>>
>> java.lang.NullPointerException
>>
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchW indow.java:1475)
>>
>>
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchW indow.java:603)
>>
>>
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWi ndow.java:579)
>>
>>
>> at
>> org.eclipse.ui.internal.WorkbenchWindow$2.run(WorkbenchWindo w.java:696)
>>
>> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
>>
>> at
>> org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindo w.java:694)
>>
>> at org.eclipse.jface.window.Window.handleShellCloseEvent(Window .java:732)
>>
>> at org.eclipse.jface.window.Window$3.shellClosed(Window.java:67 8)
>>
>> at
>> org.eclipse.swt.events.ShellEvent.dispatchToObserver(ShellEv ent.java:39)
>>
>> at com.w4t.event.Event.processEvent(Event.java:45)
>>
>> at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)
>>
>> at org.eclipse.swt.widgets.Shell.close(Shell.java:606)
>>
>> at
>> de.beyondsoft.voipconf.web.ui.VoIPConfActionBarAdvisor$1.run (VoIPConfActionBarAdvisor.java:45)
>>
>>
>> at org.eclipse.jface.action.Action.runWithEvent(Action.java:495 )
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:526)
>>
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:471)
>>
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem$4.handleEven t(ActionContributionItem.java:424)
>>
>>
>> at
>> org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatc hEvent(UntypedEventAdapter.java:244)
>>
>>
>> at
>> org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetS elected(UntypedEventAdapter.java:72)
>>
>>
>> at
>> org.eclipse.swt.events.SelectionEvent.dispatchToObserver(Sel ectionEvent.java:116)
>>
>>
>> at com.w4t.event.Event.processEvent(Event.java:45)
>>
>> at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.ja va:76)
>>
>> at
>> org.eclipse.swt.events.TypedEvent.processEventClass(TypedEve nt.java:117)
>>
>> at
>> org.eclipse.swt.events.TypedEvent.processScheduledEvents(Typ edEvent.java:57)
>>
>>
>> at
>> org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.proce ssAction(DisplayLCA.java:231)
>>
>>
>> at
>> org.eclipse.swt.internal.lifecycle.ProcessAction.execute(Pro cessAction.java:27)
>>
>>
>> at
>> org.eclipse.swt.internal.lifecycle.RWTLifeCycle.execute(RWTL ifeCycle.java:78)
>>
>>
>> at com.w4t.engine.W4TModel$ServiceAdapter.execute(W4TModel.java :47)
>>
>> at
>> com.w4t.engine.service.FormRequestServiceHandler.service(For mRequestServiceHandler.java:65)
>>
>>
>> at
>> com.w4t.engine.service.ServiceManager$HandlerDispatcher.serv ice(ServiceManager.java:104)
>>
>>
>> at com.w4t.engine.W4TDelegate.doPost(W4TDelegate.java:75)
>>
>> at
>> org.eclipse.ui.internal.servlet.RequestHandler.service(Reque stHandler.java:41)
>>
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>
>> at
>> org.eclipse.equinox.http.registry.internal.ServletManager$Se rvletWrapper.service(ServletManager.java:180)
>>
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ServletRegistratio n.handleRequest(ServletRegistration.java:90)
>>
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.proce ssAlias(ProxyServlet.java:109)
>>
>>
>> at
>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.servi ce(ProxyServlet.java:59)
>>
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>
>> at
>> org.eclipse.equinox.http.jetty.internal.HttpServerManager$In ternalHttpServiceServlet.service(HttpServerManager.java:280)
>>
>>
>> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder .java:428)
>>
>> at
>> org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHan dler.java:677)
>>
>>
>> at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandl er.java:568)
>>
>> at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>>
>> at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>>
>> at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>>
>> at org.mortbay.http.HttpConnection.service(HttpConnection.java: 820)
>>
>> at org.mortbay.http.HttpConnection.handleNext(HttpConnection.ja va:986)
>>
>> at org.mortbay.http.HttpConnection.handle(HttpConnection.java:8 37)
>>
>> at
>> org.mortbay.http.SocketListener.handleConnection(SocketListe ner.java:245)
>>
>> at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:3 57)
>>
>> at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:5 34)
>>
>> "Ruediger Herrmmann" <ruediger.herrmann@gmx.de> schrieb im Newsbeitrag
>> news:f2i1h4$k33$1@build.eclipse.org...
>>> Hi Roberto,
>>>
>>> here is a limited workaround that closes the workbench window and
>>> then reaches down to w4t and attaches a PhaseListener that
>>> invalidates the session after the current request was processed.
>>> Thus You will end up with an empty client document just showing the
>>> background image.
>>>
>>>
>>> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l().close();
>>> W4TContext.getLifeCycle().addPhaseListener( new PhaseListener() {
>>> private static final long serialVersionUID = 1L;
>>>
>>> public void beforePhase( final PhaseEvent event ) {
>>> // do nothing
>>> }
>>>
>>> public void afterPhase( final PhaseEvent event ) {
>>> W4TContext.getLifeCycle().removePhaseListener( this );
>>> ContextProvider.getSession().invalidate();
>>> }
>>>
>>> public PhaseId getPhaseId() {
>>> return PhaseId.RENDER;
>>> }
>>> } );
>>>
>>>
>>> Hope that helps
>>> Rüdiger
>>>
>>>
>>> Roberto Sá‡nchez wrote:
>>>> Hello all,
>>>>
>>>> What is the best way to close the application ? or dispose http
>>>> session ?
>>>>
>>>> I'm tryed with: "PlatformUI.getWorkbench().close();", but It isn't
>>>> implemented yet, Is there any alternatives/workarround ?
>>>>
>>>> Thanks in advance.
>>>> Roberto.
>>
>>
Previous Topic:Printing View
Next Topic:Opening a PDF, HTML, or other document in a new browser window
Goto Forum:
  


Current Time: Fri Sep 20 20:12:19 GMT 2024

Powered by FUDForum. Page generated in 0.03778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top