/* |
* Licensed to the Apache Software Foundation (ASF) under one or more |
* contributor license agreements. See the NOTICE file distributed with |
* this work for additional information regarding copyright ownership. |
* The ASF licenses this file to You under the Apache License, Version 2.0 |
* (the "License"); you may not use this file except in compliance with |
* the License. You may obtain a copy of the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
* See the License for the specific language governing permissions and |
* limitations under the License. |
*/
|
Some excerpt from reactor (Sping-VmWare) - API.
Interesing Generics notation
for static construction.
note being seem around.
"I'm feel like a changed man...no matter far for done."
/**
* Wrap the given object with an {@link Event}.
*
* @param obj The object to wrap.
public static <T> Event<T> wrap(
* @return The new {@link Event}.
* /T obj) {
return new Event<T>(obj);
}
/**
and set the {@link Event#getReplyTo() replyTo} to the given {@code
* replyToKey}.
*
The
* @param obj
* Wrap the given object with an {@link Event } object to wrap.
* @param replyToKey The key to use as a {@literal replyTo}.
* @param <T> The type of the given object.
* @return The new {@link Event}.
*/
static <T> Event<T> wrap(T obj, Object replyToKey) {
public
return new Event<T>(obj).setReplyTo(replyToKey);
}
Happens "BEFORE". Du now - but moure here seems floating on water.
"
In Java[edit]
The Java programming language also has the volatile keyword, but it is used for a somewhat different purpose. When applied to a field, the Java volatile guarantees that:
- (In all versions of Java) There is a global ordering on the reads and writes to a volatile variable. This implies that every thread accessing a volatile field will read its current value before continuing, instead of (potentially) using a cached value. (However, there is no guarantee about the relative ordering of volatile reads and writes with regular reads and writes, meaning that it's generally not a useful threading construct.)
- (In Java 5 or later) Volatile reads and writes establish a happens-before relationship, much like acquiring and releasing a mutex.[9]
Using volatile may be faster than a lock, but it will not work in some situations. [citation needed] The range of situations in which volatile is effective was expanded in Java 5; in particular, double-checked locking now works correctly. [10]"
|