package com.zyeeda.framework.ws.base;

import javax.servlet.ServletContext;

import org.apache.tapestry5.ioc.Registry;

import com.zyeeda.framework.FrameworkConstants;
import com.zyeeda.framework.ldap.LdapService;
import com.zyeeda.framework.ldap.internal.SunLdapServiceProvider;
import com.zyeeda.framework.persistence.PersistenceService;
import com.zyeeda.framework.persistence.internal.DefaultPersistenceServiceProvider;
import com.zyeeda.framework.security.SecurityService;
import com.zyeeda.framework.security.internal.OpenIdProviderSecurityServiceProvider;
import com.zyeeda.framework.utils.IocUtils;

public class ResourceService {
	
	private ServletContext ctx;
	private Registry reg;

	public ResourceService(ServletContext ctx) {
		this.ctx = ctx;
		this.reg = (Registry) this.ctx.getAttribute(FrameworkConstants.SERVICE_REGISTRY);
	}
	
	protected ServletContext getServletContext() {
		return this.ctx;
	}
	
	protected Registry getServiceRegistry() {
		return this.reg;
	}
	
	protected PersistenceService getPersistenceService() {
		return this.reg.getService(IocUtils.getServiceId(DefaultPersistenceServiceProvider.class), PersistenceService.class);
	}
	
	protected SecurityService<?> getSecurityService() {
		return this.reg.getService(IocUtils.getServiceId(OpenIdProviderSecurityServiceProvider.class), SecurityService.class);
	}
	
	protected LdapService getLdapService() {
		return this.reg.getService(IocUtils.getServiceId(SunLdapServiceProvider.class), LdapService.class);
	}
	
}

@@ -531,30 +531,30 @@
 ernal.OpenId
-Provid
+Consum
 erSecuritySe
@@ -1308,22 +1308,22 @@
 d(OpenId
-Provid
+Consum
 erSecuri

修改ResourceService 中 getSecurityService 方法体中的参数为OpenIdConsumerSecurityServiceProvider