AbstractEJBMetaData(final Class<T> remoteInterfaceClass, final EJBHomeLocator<H> homeLocator) { Assert.checkNotNullParam("remoteInterfaceClass", remoteInterfaceClass); Assert.checkNotNullParam("homeLocator", homeLocator); this.remoteInterfaceClass = remoteInterfaceClass; this.homeLocator = homeLocator; }
ContextPermission(final String name, final int actionBits) { super(name); Assert.checkNotNullParam("name", name); this.actionBits = actionBits & ACTION_ALL; }
/** * Construct a new instance. * * @param delegates the array of delegates (must not be {@code null}) */ public AggregateDiscoveryProvider(final DiscoveryProvider[] delegates) { Assert.checkNotNullParam("delegates", delegates); this.delegates = delegates; }
public Builder setClusterNodeSelector(final ClusterNodeSelector clusterNodeSelector) { Assert.checkNotNullParam("clusterNodeSelector", clusterNodeSelector); this.clusterNodeSelector = clusterNodeSelector; return this; }
/** * Construct a new instance. * * @param serviceType the service type (must not be {@code null}) * @param filterSpec the filter specification (must not be {@code null}) */ public ServiceDescription(final ServiceType serviceType, final FilterSpec filterSpec) { Assert.checkNotNullParam("serviceType", serviceType); Assert.checkNotNullParam("filterSpec", filterSpec); this.serviceType = serviceType; this.filterSpec = filterSpec; }
/** * Construct a new instance. * * @param nodeName the associated node name (must not be {@code null}) */ public NodeAffinity(final String nodeName) { Assert.checkNotNullParam("nodeName", nodeName); this.nodeName = nodeName; }
public Builder addClientCluster(EJBClientCluster cluster) { Assert.checkNotNullParam("cluster", cluster); if (clientClusters == null) { clientClusters = new ArrayList<>(); } clientClusters.add(cluster); return this; }
/** * Get the first attribute value for the given name. * * @param name the attribute name (must not be {@code null}) * @param defaultValue the value to return if no such attribute exists * @return the first attribute value for the given name, or {@code defaultValue} if no such attribute exists */ public AttributeValue getFirstAttributeValue(String name, AttributeValue defaultValue) { Assert.checkNotNullParam("name", name); final List<AttributeValue> list = attributes.getOrDefault(name, Collections.emptyList()); return list.isEmpty() ? defaultValue : list.get(0); }
public Builder addInterceptor(EJBClientInterceptor interceptor) { Assert.checkNotNullParam("interceptor", interceptor); if (globalInterceptors == null) { globalInterceptors = new ArrayList<>(); } globalInterceptors.add(EJBClientInterceptorInformation.forInstance(interceptor)); return this; }
/** * Resolve the corresponding invocation handler. * * @return the invocation handler */ @SuppressWarnings("unused") protected Object readResolve() { final EJBLocator<?> locator = this.locator; Assert.checkNotNullParam("locator", locator); return readResolve(locator); }
boolean compareAndSetStrongAffinity(final Affinity expectedAffinity, final Affinity newAffinity) { Assert.checkNotNullParam("expectedAffinity", expectedAffinity); Assert.checkNotNullParam("newAffinity", newAffinity); final AtomicReference<EJBLocator<T>> locatorRef = this.locatorRef; EJBLocator<T> oldVal = locatorRef.get(); if (! oldVal.getAffinity().equals(expectedAffinity)) { return false; } EJBLocator<T> newVal = oldVal.withNewAffinity(newAffinity); return locatorRef.compareAndSet(oldVal, newVal); } }
private EJBMethodLocator(final String methodName, final String[] parameterTypeNames, boolean copy) { Assert.checkNotNullParam("methodName", methodName); Assert.checkNotNullParam("parameterTypeNames", parameterTypeNames); this.methodName = methodName; final int length = parameterTypeNames.length; String[] clone = this.parameterTypeNames = copy && length > 0 ? parameterTypeNames.clone() : parameterTypeNames; for (int i = 0; i < length; i++) { Assert.checkNotNullArrayParam("parameterTypeNames", i, clone[i]); } hashCode = calcHashCode(methodName, parameterTypeNames); }
default ExceptionSupplier<R, E> compose(ExceptionSupplier<? extends T, ? extends E> before1, ExceptionSupplier<? extends U, ? extends E> before2) { Assert.checkNotNullParam("before1", before1); Assert.checkNotNullParam("before2", before2); return () -> apply(before1.get(), before2.get()); } }
public void convertToStateful(@NotNull final SessionID sessionId) throws IllegalArgumentException, IllegalStateException { Assert.checkNotNullParam("sessionId", sessionId); final SessionID ourSessionId = this.sessionId; if (ourSessionId != null) { if (! sessionId.equals(ourSessionId)) { throw new IllegalStateException(); } } else { this.sessionId = sessionId; } }
default ExceptionObjIntConsumer<T, E> andThen(ExceptionObjLongConsumer<? super T, ? extends E> after) { Assert.checkNotNullParam("after", after); return (t, v) -> { accept(t, v); after.accept(t, v); }; }
default <R> ExceptionBiFunction<T, U, R, E> andThen(ExceptionLongFunction<R, E> after) { Assert.checkNotNullParam("after", after); return (t, u) -> after.apply(apply(t, u)); } }
/** * Get the current weak affinity of a proxy. * * @param proxy the proxy (must not be {@code null}) * @return the affinity (not {@code null}) * @throws IllegalArgumentException if the given proxy is not a valid client proxy instance */ public static Affinity getWeakAffinity(Object proxy) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); return EJBInvocationHandler.forProxy(proxy).getWeakAffinity(); }
default ExceptionConsumer<T, E> andThen(ExceptionConsumer<? super T, ? extends E> after) { Assert.checkNotNullParam("after", after); return t -> { accept(t); after.accept(t); }; }
default ExceptionBiConsumer<T, U, E> andThen(ExceptionBiConsumer<? super T, ? super U, ? extends E> after) { Assert.checkNotNullParam("after", after); return (t, u) -> { accept(t, u); after.accept(t, u); }; }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) && getSessionId().equals(sessionId) ? this : new StatefulEJBLocator<T>(this, sessionId, affinity); }