Skip to content

Commit

Permalink
Removing always-on logging filter. Closes Azure#6
Browse files Browse the repository at this point in the history
  • Loading branch information
lodejard committed Nov 11, 2011
1 parent 91136b0 commit 499eb28
Showing 1 changed file with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,26 @@
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.LoggingFilter;

public class Exports implements Builder.Exports {

public void register(Registry registry) {
registry.add(new Builder.Factory<ClientConfig>() {
public ClientConfig create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = new DefaultClientConfig();
for(Entry<String, Object> entry : properties.entrySet()) {
clientConfig.getProperties().put(entry.getKey(), entry.getValue());
}
return clientConfig;
}
});

registry.add(new Builder.Factory<Client>() {
public Client create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = (ClientConfig) properties.get("ClientConfig");
Client client = Client.create(clientConfig);
client.addFilter(new LoggingFilter());
return client;
}
});
}
public void register(Registry registry) {
registry.add(new Builder.Factory<ClientConfig>() {
public ClientConfig create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = new DefaultClientConfig();
for (Entry<String, Object> entry : properties.entrySet()) {
clientConfig.getProperties().put(entry.getKey(), entry.getValue());
}
return clientConfig;
}
});

registry.add(new Builder.Factory<Client>() {
public Client create(String profile, Builder builder, Map<String, Object> properties) {
ClientConfig clientConfig = (ClientConfig) properties.get("ClientConfig");
Client client = Client.create(clientConfig);
return client;
}
});
}
}

0 comments on commit 499eb28

Please sign in to comment.