abstract class AbstractManagedResource[R] extends ManagedResource[R] with ManagedResourceOperations[R]
Abstract class implementing most of the managed resource features in terms of an open and close method. This is a refinement over ManagedResourceOperations as it defines the acquireForMethod generically using the scala.util.control.Exception API.
- Alphabetic
- By Inheritance
- AbstractManagedResource
- ManagedResourceOperations
- OperationsCompat
- ManagedResource
- ManagedResourceCompat
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new AbstractManagedResource()
Abstract Value Members
-
abstract
def
open: R
Opens a given resource, returning a handle to execute against during the "session" of the resource being open.
Opens a given resource, returning a handle to execute against during the "session" of the resource being open.
- Attributes
- protected
-
abstract
def
unsafeClose(handle: R, errors: Option[Throwable]): Unit
Closes a resource using the handle.
Closes a resource using the handle. This method will throw any exceptions normally occurring during the closing of a resource.
- Attributes
- protected
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
acquireAndGet[B](f: (R) ⇒ B): B
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately, except in the case of an error. Upon error, the resource will be closed, and then the originating exception will be thrown.
Note: This method will throw the last exception encountered by the managed resource, whatever this happens to be.
- f
A function to execute against the handle returned by the resource
- returns
The result of the passed in function
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
def
acquireFor[B](f: (R) ⇒ B): ExtractedEither[List[Throwable], B]
Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Aquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately in an Either container. This container will hold all errors, if any occurred during execution, or the resulting value.
- f
A function to execute against the raw resource.
- returns
The result of the function (right) or the list of exceptions seen during the processing of the resource (left).
- Definition Classes
- AbstractManagedResource → ManagedResource
-
def
and[B](that: ManagedResource[B]): ManagedResource[(R, B)]
Creates a new resource that is the aggregation of this resource and another.
Creates a new resource that is the aggregation of this resource and another.
- that
the other resource
- returns
A resource that is a tupled combination of this and that.
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
def
apply[B](f: (R) ⇒ B): B
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed.
Acquires the resource for the Duration of a given function, The resource will automatically be opened and closed. The result will be returned immediately, except in the case of an error. Upon error, the resource will be closed, and then the originating exception will be thrown.
Note: This method will throw the last exception encountered by the managed resource, whatever this happens to be.
- f
A function to execute against the handle returned by the resource
- returns
The result of the passed in function
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (R) ⇒ ManagedResource[B]): ManagedResource[B]
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.
- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
def
foreach(f: (R) ⇒ Unit): Unit
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning.
This method is used to immediately perform operations on a resource while it is open, ensuring the resource is closed before returning. Note: This method *will* open and close the resource, performing the body of the method immediately.
- f
The function to apply against the raw resource.
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isFatal(t: Throwable): Boolean
This checks to see if an exception should not be caught, under any circumstances.
This checks to see if an exception should not be caught, under any circumstances. These usually denote fatal program flaws.
- Attributes
- protected
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isRethrown(t: Throwable): Boolean
These are a list of exceptions we *have* to rethrow, regardless of a users desires to ensure that thread/return behavior in scala is accurate.
These are a list of exceptions we *have* to rethrow, regardless of a users desires to ensure that thread/return behavior in scala is accurate.
- Attributes
- protected
-
def
map[B](f: (R) ⇒ B): ExtractableManagedResource[B]
This method is used to perform operations on a resource while the resource is open.
This method is used to perform operations on a resource while the resource is open.
- f
The transformation function to apply against the raw resource.
- returns
A new ManagedResource with the translated type or some other type if an appropriate translator was found.
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toFuture(implicit context: ExecutionContext): Future[R]
This method creates a Future that will perform operations within the context of an "open" resource.
This method creates a Future that will perform operations within the context of an "open" resource. Execution of Future will hold error as Failure, otherwise result will be inside a Success.
- Definition Classes
- ManagedResourceOperations → ManagedResource
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toTraversable[B](implicit ev: <:<[R, TraversableOnce[B]]): Traversable[B]
- Definition Classes
- OperationsCompat
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()