Package com.alibaba.demo.cooma.car

Examples of com.alibaba.demo.cooma.car.Car.run()


        ExtensionLoader<Car> extensionLoader = ExtensionLoader.getExtensionLoader(Car.class);

        // 演示 扩展的获得、关联扩展点的注入(Car扩展点引用了Wheel)

        Car defaultCar = extensionLoader.getDefaultExtension();
        defaultCar.run();

        System.out.println("=================================");

        Car car1 = extensionLoader.getExtension("racing");
        car1.run();
View Full Code Here


        defaultCar.run();

        System.out.println("=================================");

        Car car1 = extensionLoader.getExtension("racing");
        car1.run();

        System.out.println("=================================");

        Car car2 = extensionLoader.getExtension("sport", Utils.kv2Map(Wheel.class.getName(), "wood"));
        car2.run(); // 缺省使用RubberWheel
View Full Code Here

        car1.run();

        System.out.println("=================================");

        Car car2 = extensionLoader.getExtension("sport", Utils.kv2Map(Wheel.class.getName(), "wood"));
        car2.run(); // 缺省使用RubberWheel

        System.out.println("=================================");

        Car car3 = extensionLoader.getExtension(Utils.kv2Map(Car.class.getName(), "racing", Wheel.class.getName(), "wood"));
        car3.run(); // 缺省使用RubberWheel
View Full Code Here

        car2.run(); // 缺省使用RubberWheel

        System.out.println("=================================");

        Car car3 = extensionLoader.getExtension(Utils.kv2Map(Car.class.getName(), "racing", Wheel.class.getName(), "wood"));
        car3.run(); // 缺省使用RubberWheel

        // 演示 Wrapper的使用

        System.out.println("=================================");
View Full Code Here

        Car countedSportCar1 = extensionLoader.getExtension("sport", Arrays.asList("run_counter"));
        Car countedSportCar2 = extensionLoader.getExtension("sport", Arrays.asList("run_counter"));

        countedSportCar1.run();
        countedSportCar2.run();
        countedSportCar1.run();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.