001package org.granite.messaging.reflect; 002 003import java.lang.reflect.Constructor; 004import java.lang.reflect.InvocationTargetException; 005 006public class ConstructorInstantiator implements Instantiator { 007 008 private final Constructor<?> constructor; 009 010 public ConstructorInstantiator(Constructor<?> constructor) { 011 this.constructor = constructor; 012 } 013 014 @Override 015 public Object newInstance() throws InstantiationException, IllegalAccessException, InvocationTargetException { 016 return constructor.newInstance(); 017 } 018}