Replacement methode for currentSession() - wakanda

Is there a replacement for the currentSession() method that can already be used? I noticed that this method is deprecated after v11.
All the examples in the docs still use the currentSession() methode.
Ex.: http://doc.wakanda.org/home2.en.html#/Global-Application/Application/getSession.301-1089198.en.html

And there will be removed in v2.x.
These two global APIs are now available in the directory object since v1.1.0.
directory.currentSession
directory.currentUser
Source : Wakanda API Reference

Related

Couchbase modify meta data experation using Spring

When using Spring Couchbase connector I can easily get version for optimistic locking by having this in my class:
public class MyClass {
#Version
private String version;
.... rest of class omitted ....
}
I'm now trying to find a similar way to get and be able to modify the meta data for expiration. I'm unable to find how to do this.
Can someone please give an example? Thanks!
With spring data couchbase library (until the latest Version 3.0.8.RELEASE), document expiry can be defined by using #Document(expiry = 10) or #Document(expiryExpression = "${valid.document.expiry}") on the class. There is also an optional boolean attribute touchOnRead which needs to be added with #Document, which would reset the expiry timer whenever the document is directly read. Please note that currently the expiry of an existing document cannot be read/modified directly with this library. One way would be to access the below APIs exposed by Couchbase's own java SDK (com.couchbase.client.java)
getAndTouch - allows you to retrieve a document while modifying its expiration time
touch - allows you to modify a document’s expiration time without otherwise accessing the document
You can find the method signatures of the above two here : http://docs.couchbase.com/sdk-api/couchbase-java-client-2.2.4/com/couchbase/client/java/Bucket.html
The above two APIs can be accessed via the spring data couchbase library as follows
couchbaseTemplate.getCouchbaseBucket().touch(...)
couchbaseTemplate.getCouchbaseBucket().getAndTouch(...)
The getCouchbaseBucket() method of the spring library returns a reference to com.couchbase.client.java.Bucket using which the touch and getAndTouch methods can be used.

Example of new abstract new abstract CreateContainerExtension method in 7.1.0.172-pre

Does anyone have an example of the new abstract method CreateContainerExtension that is in Prism.Wpf 7.1.0.172-pre? We are using the common service locator and have essentially bypassed IOC in Prism because we need to resolve things before the Bootstrapper has run.
You should remember that Prism is open source and the source code is in itself a form of documentation.
If you're using the classic Bootstrapper, you'll notice that it has been deprecated in favor of PrismApplication. Since your question is extremely vague as to what container you're even trying to use, it's impossible to tell exactly which Container Extension to use, but I will provide an example using Unity for your reference.
Whether you look at the UnityBootstraper or the Unity PrismApplication, you'll see that it simply returns an instance of the UnityContainerExtension.
protected override IContainerExtension CreateContainerExtension()
{
return new UnityContainerExtension();
}

JavaFx Tableview refresh() method alternative

I have one issue with my application which is solved using refresh() method of TableView. But this method is available since JavaFX 8u60. Our production environment uses build version prior to that. Can anyone let me know which method should I use in prior versions?
I was able to fix the issue by using the body of refresh() method. I was unable to use refresh() method in prior versions to mentioned version as the method was private. So I used the body of refresh() instead of refresh().
table.getProperties().put(TableViewSkinBase.RECREATE, Boolean.TRUE);

why is DefaultAnnotationHandlerMapping deprecated?

In Spring MVC, class DefaultAnnotationHandlerMapping is deprecated. Documentation ( http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/mvc/annotation/DefaultAnnotationHandlerMapping.html ) says:
Deprecated.
in Spring 3.2 in favor of RequestMappingHandlerMapping
Why is it deprecated? What practical problems of this class were fixed in RequestMappingHandlerMapping?
Spring Framework is an open-source project hosted on GitHub so all this information is easy to find in the code:
Find the source file in question: click
Switch to "blame" view: click
Find all occurences of "#Deprecated" to find the associated commit: click
Commit message mentions "SPR-10005", find it on Spring JIRA: click
The JIRA ticket contains a link to the "what's new in version 3.1.3" document: click
The relevant part:
The new classes were developed in response to many requests to make annotation controller support classes more customizable and open for extension. Whereas previously you could configure a custom annotated controller method argument resolver, with the new support classes you can customize the processing for any supported method argument or return value type.

Removing an added provider in Jersey

I am using com.yammer.dropwizard.config.Environment addProvider method to register providers in Jersey.I have a custom provider too which does a task similar to Dropwizards own MessageBodyWriterProvider.
Jersey seems to select the inbuilt MessageBodyWriter instead of my custom one.So I figured that if I remove the inbuild provider which is registered and register my own it will work properly.
Is there a way to remove the already added provider with the class name or other way?
environment.getJerseyResourceConfig().getSingletons()
returns a mutable Set<Object> of all the resources and providers registered with Jersey. A simple iteration over this with an instanceOf check should be enough.
The related method getProviderSingletons won't work because it is returning a new set. And removing from that set won't remove from the original.

Resources