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 org.apache.myfaces.trinidad.context;
20
21 import javax.faces.context.ExternalContext;
22
23 /**
24 * <p>
25 * Application-scoped factory for creating per-Session WindowManager instances. It is the
26 * WindowManagerFactory implementation's responsibility to ensure that only one
27 * WindowManager instance is created per-session. The WindowManagerFactory is also responsible
28 * for ensuring that any mutable state in the WindowManager instances will be successfully failed
29 * over.
30 * </p>
31 * <p>
32 * The factory is usually specified by placing the name of the WindowManagerFactory
33 * implementation class in a file named
34 * <code>org.apache.myfaces.trinidad.context.WindowManagerFactory</code>
35 * in the <code>META-INF/services</code> directory
36 * </p>
37 * @see org.apache.myfaces.trinidad.context.WindowManager
38 * @see org.apache.myfaces.trinidad.context.RequestContext#getWindowManager
39 */
40 abstract public class WindowManagerFactory
41 {
42 /**
43 * Returns the WindowManager to use for this session, creating a new instance if one doesn't
44 * already exist.
45 * @param extContext ExternalContext
46 * @return WindowManager to use for this Session
47 */
48 public abstract WindowManager getWindowManager(ExternalContext extContext);
49 }