package com.woinject;

import com.google.inject.Injector;

/**
 * @author <a href="mailto:hprange@gmail.com">Henrique Prange</a>
 */
public class Interceptor {
    public static Object injectMembers(Object object) {
	Injector injector = InjectableApplication.application().injector();

	if (injector == null) {
	    return object;
	}

	injector.injectMembers(object);

	return object;
    }

    // public static Object intercept(Class<?> clazz, Object[] parameters) {
    // System.out.println("\tClass: " + clazz + " Parameters: " +
    // java.util.Arrays.toString(parameters));
    //
    // if (WOSession.class.isAssignableFrom(clazz)) {
    // System.out.println("Creating an instace of " + clazz.getName());
    //
    // Object instance = injector().getInstance(clazz);
    //
    // return instance;
    // }
    //
    // if (EOEnterpriseObject.class.isAssignableFrom(clazz)) {
    // System.out.println("Creating an instace of " + clazz.getName());
    //
    // Object instance = injector().getInstance(clazz);
    //
    // return instance;
    // }
    //
    // return null;
    // }
}

/**
 * Copyright (C) 2010 hprange <hprange@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.woinject;

import com.google.inject.Injector;

/**
 * @author <a href="mailto:hprange@gmail.com">Henrique Prange</a>
 */
public class Interceptor {
    public static Object injectMembers(Object object) {
	Injector injector = InjectableApplication.application().injector();

	if (injector == null) {
	    return object;
	}

	injector.injectMembers(object);

	return object;
    }

    // public static Object intercept(Class<?> clazz, Object[] parameters) {
    // System.out.println("\tClass: " + clazz + " Parameters: " +
    // java.util.Arrays.toString(parameters));
    //
    // if (WOSession.class.isAssignableFrom(clazz)) {
    // System.out.println("Creating an instace of " + clazz.getName());
    //
    // Object instance = injector().getInstance(clazz);
    //
    // return instance;
    // }
    //
    // if (EOEnterpriseObject.class.isAssignableFrom(clazz)) {
    // System.out.println("Creating an instace of " + clazz.getName());
    //
    // Object instance = injector().getInstance(clazz);
    //
    // return instance;
    // }
    //
    // return null;
    // }
}

Add the missing license header
Add the missing license header
