Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.clustermate.dw;
 
 
 
public abstract class DWConfigBase<
  SCONFIG extends ServiceConfig,
  THIS extends DWConfigBase<SCONFIG, THIS>
    extends Configuration
    implements Cloneable
    public DWConfigBase() {
        // Let's try forcing GZIP to be disabled: may not work wrt
        // data-binding (since that'll recreate objects but...)
        overrideGZIPEnabled(false);
    }
    /*
    /**********************************************************************
    /* Abstract accessors
    /**********************************************************************
     */
    public abstract SCONFIG getServiceConfig();
    
    /*
    /**********************************************************************
    /* Copying
    /**********************************************************************
     */
    @SuppressWarnings("unchecked")
    @Override
    public THIS clone() {
        try {
            return (THIS) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Failed to clone "+getClass().getName()+", WTH?");
        }
    }
    
    /*
    /**********************************************************************
    /* Additional mutators; needed to work around DW strict access
    /**********************************************************************
     */
    @SuppressWarnings("unchecked")
    public THIS overrideHttpPort(int p) {
        getHttpConfiguration().setPort(p);
        return (THIS) this;
    }
    @SuppressWarnings("unchecked")
    public THIS overrideAdminPort(int p) {
        getHttpConfiguration().setAdminPort(p);
        return (THIS) this;
    }
    @SuppressWarnings("unchecked")
    public THIS overrideGZIPEnabled(boolean state) {
        return (THIS) this;
    }
    @SuppressWarnings("unchecked")
    public THIS setShutdownGracePeriod(Duration d) {
        return (THIS) this;
    }
    @SuppressWarnings("unchecked")
    public THIS setSyncGracePeriod(TimeSpan t) {
        getServiceConfig(). = t;
        return (THIS) this;
    }

    
Method called to suppress all request logging; usually during testing.
    @SuppressWarnings("unchecked")
    public THIS disableRequestLog() {
        reqLog.getConsoleConfiguration().setEnabled(false);
        reqLog.getFileConfiguration().setEnabled(false);
        reqLog.getSyslogConfiguration().setEnabled(false);
        return (THIS) this;
    }
New to GrepCode? Check out our FAQ X