@SuppressWarnings("rawtypes")
	private BeanDefinition createExporterBeanDefinition(String beanName,
			String serviceName, Class serviceInterface, Exposer exposer) {

		BeanDefinitionBuilder beanDefinitionBuilder = null;

		if (Exposer.BURLAP == exposer) {
			beanDefinitionBuilder = BeanDefinitionBuilder
					.genericBeanDefinition(BurlapServiceExporter.class)
					.addPropertyReference("service", serviceName)
					.addPropertyValue("serviceInterface", serviceInterface);
		} else if (Exposer.HESSIAN == exposer) {
			beanDefinitionBuilder = BeanDefinitionBuilder
					.genericBeanDefinition(HessianServiceExporter.class)
					.addPropertyReference("service", serviceName)
					.addPropertyValue("serviceInterface", serviceInterface);
		} else if (Exposer.HTTP == exposer) {
			beanDefinitionBuilder = BeanDefinitionBuilder
					.genericBeanDefinition(HttpInvokerServiceExporter.class)
					.addPropertyReference("service", serviceName)
					.addPropertyValue("serviceInterface", serviceInterface);
		} else if (Exposer.RMI == exposer) {
			beanDefinitionBuilder = BeanDefinitionBuilder
					.genericBeanDefinition(RmiServiceExporter.class)
					.addPropertyReference("service", serviceName)
					.addPropertyValue("serviceName",
							beanName.substring(1, beanName.length()))
					.addPropertyValue("serviceInterface", serviceInterface)
					.addPropertyValue("alwaysCreateRegistry",
							isAlwaysCreateRegistry());
			if (0 != getRmiRegistryPort())
				beanDefinitionBuilder.addPropertyValue("registryPort",
						getRmiRegistryPort());
			if (!StringUtils.isEmpty(getRmiRegistryHost()))
				beanDefinitionBuilder.addPropertyValue("registryHost",
						getRmiRegistryHost());

			if (LOGGER.isDebugEnabled())
				LOGGER.debug(
						"Building RmiServiceExporter with [service={}, serviceName={}, serviceInterface={}, registryHost={}, registryPort={}]",
						new Object[] {
								serviceName,
								beanName,
								serviceInterface,
								beanDefinitionBuilder.getBeanDefinition()
										.getPropertyValues()
										.getPropertyValue("registryHost"),
								beanDefinitionBuilder.getBeanDefinition()
										.getPropertyValues()
										.getPropertyValue("registryPort") });
		}

		return beanDefinitionBuilder.getBeanDefinition();
	}