KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > wsrp > InitCookieImpl


1 /*
2  * Copyright 2001-2003 The eXo platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  */

5
6 package org.exoplatform.portlets.wsrp;
7
8
9 import javax.xml.rpc.ServiceException JavaDoc;
10 import org.exoplatform.container.PortalContainer;
11 import org.exoplatform.services.wsrp.consumer.templates.InitCookieTemplate;
12 import org.exoplatform.services.wsrp.intf.WSRP_v1_Markup_PortType;
13 import org.exoplatform.services.wsrp.wsdl.WSRPService;
14 import org.exoplatform.services.wsrp.wsdl.WSRPServiceLocator;
15 import java.net.URL JavaDoc;
16 import java.net.MalformedURLException JavaDoc;
17
18 /**
19  * Created y the eXo platform team
20  * User: Benjamin Mestrallet
21  * Date: 11 mai 2004
22  */

23 public class InitCookieImpl extends InitCookieTemplate{
24   private WSRPService service;
25   private String JavaDoc markupInterfaceURL;
26   private WSRP_v1_Markup_PortType markupInterface;
27
28   public InitCookieImpl(String JavaDoc markupInterfaceURL) {
29     service = (WSRPService)(PortalContainer.getInstance().
30         getComponentInstanceOfType(WSRPService.class));
31     ((WSRPServiceLocator)service).setMaintainSession(true);
32     this.markupInterfaceURL = markupInterfaceURL;
33     try {
34       this.markupInterface = service.getWSRPBaseService(new URL JavaDoc(markupInterfaceURL));
35     } catch (ServiceException JavaDoc e) {
36       e.printStackTrace();
37     } catch (MalformedURLException JavaDoc e) {
38       e.printStackTrace();
39     }
40   }
41
42   public String JavaDoc getMarkupInterfaceURL() {
43     return markupInterfaceURL;
44   }
45
46   public WSRP_v1_Markup_PortType getWSRPBaseService() {
47     return markupInterface;
48   }
49
50   public void setWSRPBaseService(WSRP_v1_Markup_PortType markupPortType) {
51     this.markupInterface = markupPortType;
52   }
53 }
54
Popular Tags