Giter Site home page Giter Site logo

javaserviceproviderinterfacedemo's Introduction

JavaServiceProviderInterfaceDemo

Simple Demos for Java's SPI(Service Provider Interface) and java.util.ServiceLoader usage.

Introduction

This demo app include 6 tiny jar projects.

  1. CloudService
  • Demonstrates pseudo "Cloud Service" providers.
  • Defines spidemo.cloud.spi.Cloud interface for service provider.
  • Provides spidemo.cloud.CloudService utility class to wrap java.util.ServiceLoader<Cloud> operations.
  1. SearchService
  • Demonstrates pseudo "Keyword Search Service" providers.
  • Defines spidemo.search.spi.Search interface for service provider.
  • Provides spidemo.search.SearchService utility class to wrap java.util.ServiceLoader<Search> operations.
  1. FooProvider
  • Implementations for CloudService and SearchService.
  1. BarProvider
  • Includes two implementations for SearchService.
  1. BazProvider
  • Implementation for CloudService.
  1. DemoApp
  • client app for CloudService and SearchService.
  • Implementations self providers for both CloudService and SearchService.

Requirements

  • JDK 1.6 or over
  • Ant 1.8.x or over

Build and Run

Run default Ant target.

$ ant
run:
     [java] Provider Name: My Cloud Provider
     [java] My Container
     [java] My Tomcat
     [java] Provider Name: Foo Cloud Provider
     [java] Foo VPC
     [java] Foo VPN
     [java] Foo Shared Server
     [java] Foo Dedicated Server
     [java] Provider Name: Baz Cloud Provider
     [java] Baz Xen Computing
     [java] Baz Security Gateway
     [java] Baz Shared Storage
     [java] Provider Name: My Search Provider
     [java] My Search 1
     [java] My Search 2
     [java] Provider Name: Foo Search Provider
     [java] Foo Search 1
     [java] Foo Search 2
     [java] Foo Search 3
     [java] Provider Name: Bar Search Provider
     [java] Bar Search 1
     [java] Bar Search 2
     [java] Bar Search 3
     [java] Provider Name: Bar Search2 Provider
     [java] Bar2 Search 1
     [java] Bar2 Search 2
     [java] Bar2 Search 3

BUILD SUCCESSFUL
Total time: 12 seconds

References

(Japanese Language)

javaserviceproviderinterfacedemo's People

Contributors

msakamoto-sf avatar

Stargazers

xx avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.