javax.enterprise.inject.spi

## Class Unmanaged.UnmanagedInstance<T>

- java.lang.Object
- - javax.enterprise.inject.spi.Unmanaged.UnmanagedInstance<T>

- Enclosing class:
    Unmanaged<T>

      public static class Unmanaged.UnmanagedInstance<T>
      extends Object

  Represents a non-contextual instance.
  See Also:
    `Unmanaged`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Unmanaged.UnmanagedInstance<T>` | `dispose()` Dispose of the instance, doing any necessary cleanup
    `T` | `get()` Get the instance
    `Unmanaged.UnmanagedInstance<T>` | `inject()` Inject the instance
    `Unmanaged.UnmanagedInstance<T>` | `postConstruct()` Call the @PostConstruct callback
    `Unmanaged.UnmanagedInstance<T>` | `preDestroy()` Call the @PreDestroy callback
    `Unmanaged.UnmanagedInstance<T>` | `produce()` Create the instance

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### get

          public T get()

      Get the instance

    - #### produce

          public Unmanaged.UnmanagedInstance<T> produce()

      Create the instance
      Throws:
        `IllegalStateException` - if produce() is called on an already produced instance
        `IllegalStateException` - if produce() is called on an instance that has already been disposed

    - #### inject

          public Unmanaged.UnmanagedInstance<T> inject()

      Inject the instance
      Throws:
        `IllegalStateException` - if inject() is called before produce() is called
        `IllegalStateException` - if inject() is called on an instance that has already been disposed

    - #### postConstruct

          public Unmanaged.UnmanagedInstance<T> postConstruct()

      Call the @PostConstruct callback
      Throws:
        `IllegalStateException` - if postConstruct() is called before produce() is called
        `IllegalStateException` - if postConstruct() is called on an instance that has already been disposed

    - #### preDestroy

          public Unmanaged.UnmanagedInstance<T> preDestroy()

      Call the @PreDestroy callback
      Throws:
        `IllegalStateException` - if preDestroy() is called before produce() is called
        `IllegalStateException` - if preDestroy() is called on an instance that has already been disposed

    - #### dispose

          public Unmanaged.UnmanagedInstance<T> dispose()

      Dispose of the instance, doing any necessary cleanup
      Throws:
        `IllegalStateException` - if dispose() is called before produce() is called
        `IllegalStateException` - if dispose() is called on an instance that has already been disposed

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.