trait
CloseOnNeed extends IsClosed
Abstract Value Members
-
abstract
def
doClose: Unit
Concrete Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
def
closeResource: Unit
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
def
isClosed: Boolean
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
Mostly exists for pulling but it is general
We want to enable bracketing and a more orderly shutdown of resources from the input streams. Whilst the resource is closed automatically its not very helpful if you don't want to close it. Due to Sun bug: 6539065 we have to wrap the actual close. This allows us to decide IF we want to close.
So we cover three use cases here: * Enumeratees can bracket, if so desired * Streams of xml can be continuously plied for more xml messages * Users who want to manually close early can do so too.
As a note this fits very closely to the scala-arm stuff, which I happily use in another project. But it has two specific seperate use cases: * XmlPulls should be joinable as iterators ++ should ensure that the resources are closed * Additionally, however, closing on the resulting XmlPull should close the lot.
So we either override the ++ to behave differently or we abstract away using of the stream from closing it.