Singleton.java
Upload User: cdpainuo
Upload Date: 2022-07-12
Package Size: 5257k
Code Size: 0k
Category:

Jsp/Servlet

Development Platform:

Java

  1. package com.appspot.cindyblog.util;
  2. public class Singleton {   
  3.      
  4.     protected Singleton() {   
  5.        // Exists only to thwart instantiation.   
  6.     }   
  7.     public static synchronized <T> Object getInstance(Class<T> clazz) {   
  8.        return SingletonRegistry.REGISTRY.getInstance(clazz.getName());   
  9.     }   
  10. }