Coverage Report - javax.faces.context.ExternalContext
 
Classes in this File Line Coverage Branch Coverage Complexity
ExternalContext
0%
1/178
0%
0/80
2.067
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 18  
  */
 19  
 package javax.faces.context;
 20  
 
 21  
 import java.io.IOException;
 22  
 import java.io.OutputStream;
 23  
 import java.io.Writer;
 24  
 import java.util.Iterator;
 25  
 import java.util.List;
 26  
 import java.util.Locale;
 27  
 import java.util.Map;
 28  
 import java.util.Set;
 29  
 import javax.faces.lifecycle.ClientWindow;
 30  
 
 31  
 /**
 32  
  * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
 33  
  */
 34  1050
 public abstract class ExternalContext
 35  
 {
 36  
     public static final String BASIC_AUTH = "BASIC";
 37  
     public static final String CLIENT_CERT_AUTH = "CLIENT_CERT";
 38  
     public static final String DIGEST_AUTH = "DIGEST";
 39  
     public static final String FORM_AUTH = "FORM";
 40  
     
 41  
     /**
 42  
      *
 43  
      * @param name
 44  
      * @param value
 45  
      * @param properties
 46  
      *
 47  
      * @since 2.0
 48  
      */
 49  
     public void addResponseCookie(String name, String value, Map<String, Object> properties)
 50  
     {
 51  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 52  
         
 53  0
         if (ctx == null)
 54  
         {
 55  0
             throw new UnsupportedOperationException();
 56  
         }
 57  
         
 58  0
         ctx.addResponseCookie(name, value, properties);
 59  0
     }
 60  
 
 61  
     /**
 62  
      *
 63  
      * @param name
 64  
      * @param value
 65  
      *
 66  
      * @since 2.0
 67  
      */
 68  
     public void addResponseHeader(String name, String value)
 69  
     {
 70  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 71  
         
 72  0
         if (ctx == null)
 73  
         {
 74  0
             throw new UnsupportedOperationException();
 75  
         }
 76  
         
 77  0
         ctx.addResponseHeader(name, value);
 78  0
     }
 79  
 
 80  
     public abstract void dispatch(String path) throws IOException;
 81  
 
 82  
     public abstract String encodeActionURL(String url);
 83  
 
 84  
     /**
 85  
      *
 86  
      * @param baseUrl
 87  
      * @param parameters
 88  
      *
 89  
      * @since 2.0
 90  
      */
 91  
     public String encodeBookmarkableURL(String baseUrl, Map<String,List<String>> parameters)
 92  
     {
 93  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 94  
         
 95  0
         if (ctx == null)
 96  
         {
 97  0
             throw new UnsupportedOperationException();
 98  
         }
 99  
         
 100  0
         return ctx.encodeBookmarkableURL(baseUrl, parameters);
 101  
     }
 102  
 
 103  
     public abstract String encodeNamespace(String name);
 104  
 
 105  
 
 106  
     /**
 107  
      * @since 2.0
 108  
      */
 109  
     public String encodePartialActionURL(String url)
 110  
     {
 111  
         // TODO: IMPLEMENT IMPL
 112  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 113  
         
 114  0
         if (ctx == null)
 115  
         {
 116  0
             throw new UnsupportedOperationException();
 117  
         }
 118  
         
 119  0
         return ctx.encodePartialActionURL(url);
 120  
     }
 121  
 
 122  
     /**
 123  
      *
 124  
      * @param baseUrl
 125  
      * @param parameters
 126  
      *
 127  
      * @since 2.0
 128  
      */
 129  
     public String encodeRedirectURL(String baseUrl, Map<String,List<String>> parameters)
 130  
     {
 131  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 132  
         
 133  0
         if (ctx == null)
 134  
         {
 135  0
             throw new UnsupportedOperationException();
 136  
         }
 137  
         
 138  0
         return ctx.encodeRedirectURL(baseUrl, parameters);
 139  
     }
 140  
 
 141  
     public abstract String encodeResourceURL(String url);
 142  
 
 143  
     public abstract Map<String, Object> getApplicationMap();
 144  
 
 145  
     public abstract String getAuthType();
 146  
 
 147  
     public abstract Object getContext();
 148  
 
 149  
     /**
 150  
      * Returns the name of the underlying context
 151  
      *
 152  
      * @return the name or null
 153  
      *
 154  
      * @since 2.0
 155  
      */
 156  
     public String getContextName()
 157  
     {
 158  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 159  
         
 160  0
         if (ctx == null)
 161  
         {
 162  0
             throw new UnsupportedOperationException();
 163  
         }
 164  
         
 165  0
         return ctx.getContextName();
 166  
     }
 167  
 
 168  
     /**
 169  
      * @since 2.0
 170  
      */
 171  
     public Flash getFlash()
 172  
     {
 173  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 174  
         
 175  0
         if (ctx == null)
 176  
         {
 177  0
             throw new UnsupportedOperationException();
 178  
         }
 179  
         
 180  0
         return ctx.getFlash();
 181  
     }
 182  
 
 183  
     public abstract String getInitParameter(String name);
 184  
 
 185  
     // FIXME: Notify EG about generic usage
 186  
     public abstract Map getInitParameterMap();
 187  
 
 188  
     /**
 189  
      * @since JSF 2.0
 190  
      */
 191  
     public String getMimeType(String file)
 192  
     {
 193  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 194  
         
 195  0
         if (ctx == null)
 196  
         {
 197  0
             throw new UnsupportedOperationException();
 198  
         }
 199  
         
 200  0
         return ctx.getMimeType(file);
 201  
     }
 202  
 
 203  
     /**
 204  
      * @since JSF 2.0
 205  
      */
 206  
     public String getRealPath(String path)
 207  
     {
 208  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 209  
         
 210  0
         if (ctx == null)
 211  
         {
 212  0
             throw new UnsupportedOperationException();
 213  
         }
 214  
         
 215  0
         return ctx.getRealPath(path);
 216  
     }
 217  
 
 218  
     public abstract String getRemoteUser();
 219  
 
 220  
     public abstract Object getRequest();
 221  
 
 222  
     public String getRequestCharacterEncoding()
 223  
     {
 224  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 225  
         
 226  0
         if (ctx == null)
 227  
         {
 228  0
             throw new UnsupportedOperationException();
 229  
         }
 230  
         
 231  0
         return ctx.getRequestCharacterEncoding();
 232  
     }
 233  
 
 234  
     /**
 235  
      *
 236  
      * @return
 237  
      *
 238  
      * @since 2.0
 239  
      */
 240  
     public int getRequestContentLength()
 241  
     {
 242  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 243  
         
 244  0
         if (ctx == null)
 245  
         {
 246  0
             throw new UnsupportedOperationException();
 247  
         }
 248  
         
 249  0
         return ctx.getRequestContentLength();
 250  
     }
 251  
 
 252  
     public String getRequestContentType()
 253  
     {
 254  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 255  
         
 256  0
         if (ctx == null)
 257  
         {
 258  0
             throw new UnsupportedOperationException();
 259  
         }
 260  
         
 261  0
         return ctx.getRequestContentType();
 262  
     }
 263  
 
 264  
     public abstract String getRequestContextPath();
 265  
 
 266  
     public abstract Map<String, Object> getRequestCookieMap();
 267  
 
 268  
     public abstract Map<String, String> getRequestHeaderMap();
 269  
 
 270  
     public abstract Map<String, String[]> getRequestHeaderValuesMap();
 271  
 
 272  
     public abstract Locale getRequestLocale();
 273  
 
 274  
     public abstract Iterator<Locale> getRequestLocales();
 275  
 
 276  
     public abstract Map<String, Object> getRequestMap();
 277  
 
 278  
     public abstract Map<String, String> getRequestParameterMap();
 279  
 
 280  
     public abstract Iterator<String> getRequestParameterNames();
 281  
 
 282  
     public abstract Map<String, String[]> getRequestParameterValuesMap();
 283  
 
 284  
     public abstract String getRequestPathInfo();
 285  
 
 286  
     /**
 287  
      * @since JSF 2.0
 288  
      */
 289  
     public String getRequestScheme()
 290  
     {
 291  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 292  
         
 293  0
         if (ctx == null)
 294  
         {
 295  0
             throw new UnsupportedOperationException();
 296  
         }
 297  
         
 298  0
         return ctx.getRequestScheme();
 299  
     }
 300  
 
 301  
     /**
 302  
      * @since JSF 2.0
 303  
      */
 304  
     public String getRequestServerName()
 305  
     {
 306  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 307  
         
 308  0
         if (ctx == null)
 309  
         {
 310  0
             throw new UnsupportedOperationException();
 311  
         }
 312  
         
 313  0
         return ctx.getRequestServerName();
 314  
     }
 315  
 
 316  
     /**
 317  
      * @since JSF 2.0
 318  
      */
 319  
     public int getRequestServerPort()
 320  
     {
 321  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 322  
         
 323  0
         if (ctx == null)
 324  
         {
 325  0
             throw new UnsupportedOperationException();
 326  
         }
 327  
         
 328  0
         return ctx.getRequestServerPort();
 329  
     }
 330  
 
 331  
     public abstract String getRequestServletPath();
 332  
 
 333  
     public abstract java.net.URL getResource(String path) throws java.net.MalformedURLException;
 334  
 
 335  
     public abstract java.io.InputStream getResourceAsStream(String path);
 336  
 
 337  
     public abstract Set<String> getResourcePaths(String path);
 338  
 
 339  
     public abstract Object getResponse();
 340  
 
 341  
     /**
 342  
      *
 343  
      * @return
 344  
      *
 345  
      * @since 2.0
 346  
      */
 347  
     public int getResponseBufferSize()
 348  
     {
 349  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 350  
         
 351  0
         if (ctx == null)
 352  
         {
 353  0
             throw new UnsupportedOperationException();
 354  
         }
 355  
         
 356  0
         return ctx.getResponseBufferSize();
 357  
     }
 358  
 
 359  
     public String getResponseCharacterEncoding()
 360  
     {
 361  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 362  
         
 363  0
         if (ctx == null)
 364  
         {
 365  0
             throw new UnsupportedOperationException("JSF 1.2 : figure out how to tell if this is a Portlet request");
 366  
         }
 367  
         
 368  0
         return ctx.getResponseCharacterEncoding();
 369  
     }
 370  
 
 371  
     /**
 372  
      * throws <code>UnsupportedOperationException</code> by default.
 373  
      *
 374  
      * @since JSF 1.2
 375  
      */
 376  
     public String getResponseContentType()
 377  
     {
 378  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 379  
         
 380  0
         if (ctx == null)
 381  
         {
 382  0
             throw new UnsupportedOperationException();
 383  
         }
 384  
         
 385  0
         return ctx.getResponseContentType();
 386  
     }
 387  
 
 388  
     /**
 389  
      * @since JSF 2.0
 390  
      */
 391  
     public OutputStream getResponseOutputStream() throws IOException
 392  
     {
 393  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 394  
         
 395  0
         if (ctx == null)
 396  
         {
 397  0
             throw new UnsupportedOperationException();
 398  
         }
 399  
         
 400  0
         return ctx.getResponseOutputStream();
 401  
     }
 402  
 
 403  
     /**
 404  
      * @since JSF 2.0
 405  
      */
 406  
     public Writer getResponseOutputWriter() throws IOException
 407  
     {
 408  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 409  
         
 410  0
         if (ctx == null)
 411  
         {
 412  0
             throw new UnsupportedOperationException();
 413  
         }
 414  
         
 415  0
         return ctx.getResponseOutputWriter();
 416  
     }
 417  
 
 418  
     public abstract Object getSession(boolean create);
 419  
 
 420  
     public abstract Map<String, Object> getSessionMap();
 421  
 
 422  
     public abstract java.security.Principal getUserPrincipal();
 423  
 
 424  
     /**
 425  
      * @since 2.0
 426  
      */
 427  
     public void invalidateSession()
 428  
     {
 429  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 430  
         
 431  0
         if (ctx == null)
 432  
         {
 433  0
             throw new UnsupportedOperationException();
 434  
         }
 435  
         
 436  0
         ctx.invalidateSession();
 437  0
     }
 438  
 
 439  
     /**
 440  
      * @since 2.0
 441  
      */
 442  
     public boolean isResponseCommitted()
 443  
     {
 444  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 445  
         
 446  0
         if (ctx == null)
 447  
         {
 448  0
             throw new UnsupportedOperationException();
 449  
         }
 450  
         
 451  0
         return ctx.isResponseCommitted();
 452  
     }
 453  
 
 454  
     public abstract boolean isUserInRole(String role);
 455  
 
 456  
     /**
 457  
      * @since 2.0
 458  
      */
 459  
     public abstract void log(String message);
 460  
 
 461  
     /**
 462  
      * @since 2.0
 463  
      */
 464  
     public abstract void log(String message, Throwable exception);
 465  
 
 466  
     public abstract void redirect(String url) throws java.io.IOException;
 467  
 
 468  
     /**
 469  
      *
 470  
      * @throws IOException
 471  
      *
 472  
      * @since 2.0
 473  
      */
 474  
     public void responseFlushBuffer() throws IOException
 475  
     {
 476  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 477  
         
 478  0
         if (ctx == null)
 479  
         {
 480  0
             throw new UnsupportedOperationException();
 481  
         }
 482  
         
 483  0
         ctx.responseFlushBuffer();
 484  0
     }
 485  
 
 486  
     /**
 487  
      *
 488  
      * @since 2.0
 489  
      */
 490  
     public void responseReset()
 491  
     {
 492  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 493  
         
 494  0
         if (ctx == null)
 495  
         {
 496  0
             throw new UnsupportedOperationException();
 497  
         }
 498  
         
 499  0
         ctx.responseReset();
 500  0
     }
 501  
 
 502  
     /**
 503  
      *
 504  
      * @param statusCode
 505  
      * @param message
 506  
      * @throws IOException
 507  
      *
 508  
      * @since 2.0
 509  
      */
 510  
     public void responseSendError(int statusCode, String message) throws IOException
 511  
     {
 512  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 513  
         
 514  0
         if (ctx == null)
 515  
         {
 516  0
             throw new UnsupportedOperationException();
 517  
         }
 518  
         
 519  0
         ctx.responseSendError(statusCode, message);
 520  0
     }
 521  
 
 522  
     /**
 523  
      * throws <code>UnsupportedOperationException</code> by default.
 524  
      *
 525  
      * @since JSF 1.2
 526  
      * @param request
 527  
      */
 528  
     public void setRequest(Object request)
 529  
     {
 530  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 531  
         
 532  0
         if (ctx == null)
 533  
         {
 534  0
             throw new UnsupportedOperationException();
 535  
         }
 536  
         
 537  0
         ctx.setRequest(request);
 538  0
     }
 539  
 
 540  
     /**
 541  
      * throws <code>UnsupportedOperationException</code> by default.
 542  
      *
 543  
      * @since JSF 1.2
 544  
      * @param encoding
 545  
      * @throws java.io.UnsupportedEncodingException
 546  
      */
 547  
     public void setRequestCharacterEncoding(java.lang.String encoding)
 548  
             throws java.io.UnsupportedEncodingException
 549  
     {
 550  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 551  
         
 552  0
         if (ctx == null)
 553  
         {
 554  0
             throw new UnsupportedOperationException();
 555  
         }
 556  
         
 557  0
         ctx.setRequestCharacterEncoding(encoding);
 558  0
     }
 559  
 
 560  
     /**
 561  
      * throws <code>UnsupportedOperationException</code> by default.
 562  
      *
 563  
      * @since JSF 1.2
 564  
      * @param response
 565  
      */
 566  
     public void setResponse(Object response)
 567  
     {
 568  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 569  
         
 570  0
         if (ctx == null)
 571  
         {
 572  0
             throw new UnsupportedOperationException();
 573  
         }
 574  
         
 575  0
         ctx.setResponse(response);
 576  0
     }
 577  
 
 578  
     /**
 579  
      *
 580  
      * @param size
 581  
      *
 582  
      * @since 2.0
 583  
      */
 584  
     public void setResponseBufferSize(int size)
 585  
     {
 586  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 587  
         
 588  0
         if (ctx == null)
 589  
         {
 590  0
             throw new UnsupportedOperationException();
 591  
         }
 592  
         
 593  0
         ctx.setResponseBufferSize(size);
 594  0
     }
 595  
 
 596  
     /**
 597  
      * throws <code>UnsupportedOperationException</code> by default.
 598  
      *
 599  
      * @since JSF 1.2
 600  
      * @param encoding
 601  
      */
 602  
     public void setResponseCharacterEncoding(String encoding)
 603  
     {
 604  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 605  
         
 606  0
         if (ctx == null)
 607  
         {
 608  0
             throw new UnsupportedOperationException();
 609  
         }
 610  
         
 611  0
         ctx.setResponseCharacterEncoding(encoding);
 612  0
     }
 613  
 
 614  
     /**
 615  
      *
 616  
      * @param length
 617  
      *
 618  
      * @since 2.0
 619  
      */
 620  
     public void setResponseContentLength(int length)
 621  
     {
 622  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 623  
         
 624  0
         if (ctx == null)
 625  
         {
 626  0
             throw new UnsupportedOperationException();
 627  
         }
 628  
         
 629  0
         ctx.setResponseContentLength(length);
 630  0
     }
 631  
 
 632  
     /**
 633  
      *
 634  
      * @param contentType
 635  
      *
 636  
      * @since 2.0
 637  
      */
 638  
     public void setResponseContentType(String contentType)
 639  
     {
 640  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 641  
         
 642  0
         if (ctx == null)
 643  
         {
 644  0
             throw new UnsupportedOperationException();
 645  
         }
 646  
         
 647  0
         ctx.setResponseContentType(contentType);
 648  0
     }
 649  
 
 650  
     /**
 651  
      *
 652  
      * @param name
 653  
      * @param value
 654  
      *
 655  
      * @since 2.0
 656  
      */
 657  
     public void setResponseHeader(String name, String value)
 658  
     {
 659  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 660  
         
 661  0
         if (ctx == null)
 662  
         {
 663  0
             throw new UnsupportedOperationException();
 664  
         }
 665  
         
 666  0
         ctx.setResponseHeader(name, value);
 667  0
     }
 668  
 
 669  
     /**
 670  
      *
 671  
      * @param statusCode
 672  
      *
 673  
      * @since 2.0
 674  
      */
 675  
     public void setResponseStatus(int statusCode)
 676  
     {
 677  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 678  
         
 679  0
         if (ctx == null)
 680  
         {
 681  0
             throw new UnsupportedOperationException();
 682  
         }
 683  
         
 684  0
         ctx.setResponseStatus(statusCode);
 685  0
     }
 686  
     
 687  
     /**
 688  
      * 
 689  
      * @since 2.1
 690  
      * @return
 691  
      */
 692  
     public boolean isSecure()
 693  
     {
 694  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 695  
         
 696  0
         if (ctx == null)
 697  
         {
 698  0
             throw new UnsupportedOperationException();
 699  
         }
 700  
 
 701  0
         return ctx.isSecure();
 702  
     }
 703  
     
 704  
     /**
 705  
      * 
 706  
      * @since 2.1
 707  
      * @return
 708  
      */
 709  
     public int getSessionMaxInactiveInterval()
 710  
     {
 711  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 712  
         
 713  0
         if (ctx == null)
 714  
         {
 715  0
             throw new UnsupportedOperationException();
 716  
         }
 717  
 
 718  0
         return ctx.getSessionMaxInactiveInterval();
 719  
     }
 720  
     
 721  
     /**
 722  
      * 
 723  
      * @since 2.1
 724  
      * @param interval
 725  
      */
 726  
     public void setSessionMaxInactiveInterval(int interval)
 727  
     {
 728  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 729  
         
 730  0
         if (ctx == null)
 731  
         {
 732  0
             throw new UnsupportedOperationException();
 733  
         }
 734  
         
 735  0
         ctx.setSessionMaxInactiveInterval(interval);
 736  0
     }
 737  
 
 738  
     /**
 739  
      * @since 2.2
 740  
      * @return 
 741  
      */
 742  
     public ClientWindow getClientWindow()
 743  
     {
 744  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 745  
         
 746  0
         if (ctx == null)
 747  
         {
 748  
             /*throw new UnsupportedOperationException();*/
 749  
             // TODO: Return null for now, but it should throw exception
 750  
             // in JSF 2.2
 751  0
             return null;
 752  
         }
 753  
         
 754  0
         return ctx.getClientWindow();
 755  
     }
 756  
     
 757  
     /**
 758  
      * @since 2.2
 759  
      * @param window 
 760  
      */
 761  
     public void setClientWindow(ClientWindow window)
 762  
     {
 763  
         // No op for now.
 764  
         /*
 765  
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 766  
         
 767  
         if (ctx == null)
 768  
         {
 769  
             throw new UnsupportedOperationException();
 770  
         }
 771  
         
 772  
         ctx.setClientWindow(window);
 773  
         */
 774  0
     }
 775  
     
 776  
     /**
 777  
      * @since 2.2
 778  
      * @param create
 779  
      * @return 
 780  
      */
 781  
     public String getSessionId(boolean create)
 782  
     {
 783  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 784  
         
 785  0
         if (ctx == null)
 786  
         {
 787  0
             throw new UnsupportedOperationException();
 788  
         }
 789  
         
 790  0
         return ctx.getSessionId(create);
 791  
     }
 792  
     
 793  
     /**
 794  
      * @since 2.2
 795  
      * @return
 796  
      */
 797  
     public String getApplicationContextPath()
 798  
     {
 799  0
         ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
 800  
         
 801  0
         if (ctx == null)
 802  
         {
 803  0
             throw new UnsupportedOperationException();
 804  
         }
 805  
         
 806  0
         return ctx.getApplicationContextPath();
 807  
     }
 808  
 }