Fixes scope for sp session bean. Fixes log statements.
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / pz2utils4jsf / pazpar2 / Pz2ProxyBean.java
index 6982f9c..ae742f3 100644 (file)
@@ -13,6 +13,7 @@ import org.apache.log4j.Logger;
 \r
 import com.indexdata.pz2utils4jsf.config.Configuration;\r
 import com.indexdata.pz2utils4jsf.config.ConfigurationReader;\r
+import com.indexdata.pz2utils4jsf.pazpar2.sp.ForServiceProxy;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyClient;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxyInterface;\r
 import com.indexdata.pz2utils4jsf.pazpar2.sp.ServiceProxySession;\r
@@ -26,15 +27,15 @@ public class Pz2ProxyBean extends Pz2Bean implements ServiceProxyInterface {
   private static Logger logger = Logger.getLogger(Pz2ProxyBean.class);  \r
     \r
   @Inject ConfigurationReader configurator;\r
-  @Inject ServiceProxyUser user;\r
+  @Inject ServiceProxyUser user;  \r
+  @Inject @ForServiceProxy ServiceProxySession pz2;\r
   \r
   public Pz2ProxyBean() {\r
   }\r
   \r
   @PostConstruct\r
-  public void instantiatePz2SessionObject() {\r
-    logger.debug(Utils.objectId(this) + " will instantiate a Pz2Session object next.");\r
-    pz2 = new ServiceProxySession();\r
+  public void instantiateServiceProxyClient() {\r
+    logger.debug(Utils.objectId(this) + " will instantiate a ServiceProxyClient next.");    \r
     searchClient = new ServiceProxyClient();\r
     logger.info("Using [" + Utils.objectId(searchClient) + "] configured by [" \r
                           + Utils.objectId(configurator) + "] on session [" \r