You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2018/05/08 12:48:18 UTC
[myfaces] 15/28: copy to move history
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 2.1.x-client-window
in repository https://gitbox.apache.org/repos/asf/myfaces.git
commit f36a33a12ef54e1dd50eb14ebc089bb58bf62022
Author: Leonardo Uribe <lu...@apache.org>
AuthorDate: Fri Nov 16 03:14:49 2012 +0000
copy to move history
---
.../viewstate/StateCacheFactoryImpl.java | 50 ++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java
new file mode 100644
index 0000000..0fbbf15
--- /dev/null
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/StateCacheFactoryImpl.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.renderkit;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.application.StateCache;
+import org.apache.myfaces.application.StateCacheFactory;
+
+public class StateCacheFactoryImpl extends StateCacheFactory
+{
+
+ private StateCache _clientSideStateCache;
+ private StateCache _serverSideStateCache;
+
+ public StateCacheFactoryImpl()
+ {
+ _clientSideStateCache = new ClientSideStateCacheImpl();
+ _serverSideStateCache = new ServerSideStateCacheImpl();
+ }
+
+ @Override
+ public StateCache getStateCache(FacesContext facesContext)
+ {
+ if (facesContext.getApplication().getStateManager().isSavingStateInClient(facesContext))
+ {
+ return _clientSideStateCache;
+ }
+ else
+ {
+ return _serverSideStateCache;
+ }
+ }
+}
--
To stop receiving notification emails like this one, please contact
deki@apache.org.