protected SimpleServiceInvoker(Destination destination, SimpleServiceFactory factory) throws ServiceException { super(destination, factory); String className = destination.getProperties().get("source"); if (className == null) throw new ServiceException("No source property for destination: " + destination); className = className.trim(); log.debug(">> New SimpleServiceInvoker constructing new: %s", className); // Invokee class set at runtime (RemoteObject.source). if ("*".equals(className)) sources = new HashMap<String, Object>(); else { try { if (destination.getScannedClass() != null) this.invokee = destination.getScannedClass().newInstance(); else this.invokee = TypeUtil.newInstance(className); } catch (Exception e) { throw new ServiceException("Invalid source property for destination: " + destination, e); } sources = null; } }
protected SimpleServiceInvoker(Destination destination, SimpleServiceFactory factory) throws ServiceException { super(destination, factory); String className = destination.getProperties().get("source"); if (className == null) throw new ServiceException("No source property for destination: " + destination); className = className.trim(); log.debug(">> New SimpleServiceInvoker constructing new: %s", className); // Invokee class set at runtime (RemoteObject.source). if ("*".equals(className)) sources = new HashMap<String, Object>(); else { try { if (destination.getScannedClass() != null) this.invokee = destination.getScannedClass().newInstance(); else this.invokee = TypeUtil.newInstance(className); } catch (Exception e) { throw new ServiceException("Invalid source property for destination: " + destination, e); } sources = null; } }
public EjbServiceInvoker(Destination destination, EjbServiceFactory factory) throws ServiceException { super(destination, factory); String lookup = factory.getLookup(); if (destination.getProperties().containsKey("lookup")) lookup = destination.getProperties().get("lookup"); // Compute EJB JNDI binding. String name = destination.getId(); if (lookup != null) { name = lookup; if (lookup.contains(CAPITALIZED_DESTINATION_ID)) name = lookup.replace(CAPITALIZED_DESTINATION_ID, capitalize(destination.getId())); if (lookup.contains(DESTINATION_ID)) name = lookup.replace(DESTINATION_ID, destination.getId()); } log.debug(">> New EjbServiceInvoker looking up: %s", name); try { invokee = factory.lookup(name); } catch (NamingException e) { throw new ServiceException("Could not lookup for: " + name, e); } this.metadata = destination.getScannedClass() != null ? new EjbServiceMetadata(destination.getScannedClass(), invokee.getClass()) : new EjbServiceMetadata(destination.getProperties(), invokee.getClass()); }